On Mon, Jul 30, 2012 at 9:32 AM, Gijs Molenaar <[email protected]>wrote:
> > Hi Michael, > > Op dinsdag 10 juli 2012 17:51:16 UTC+2 schreef Michael Manfre het volgende: >> >> >> On Monday, July 9, 2012 11:25:47 AM UTC-4, Gijs Molenaar wrote: >>> >>> >>> These problems are: >>> * MonetDB supports a Decimal type with a maximum length of 18 digits. >>> >> >> Override DatabaseOperations.value_to_**db_decimal and clamp the >> max_digits to 18. I'm not sure if you'll need other modifications. >> >> > > This doesn't seem to solve the problem. This only limits the convertion of > Decimal types to 18 digits, but not the creation of the table itself. I > Think the correct place to define such a things would be do something > with DatabaseCreation.data_types. Any suggestions? > DatabaseCreation.data_types allows you to set a format string that should be used for the various types. I'm not sure how you could use that to change either max_digits or decimal_places to clamp them for MonetDB. You could monkey patch DecimalField or provide your own field that enforces the DB's limit, but I think it would be easier from a maintenance standpoint to document the limitation. People have full control over the models that they use in their projects, including from 3rd party apps. Silently changing the database schema is probably not a good policy to take. -- Michael Manfre -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
