Op maandag 30 juli 2012 16:05:14 UTC+2 schreef Michael Manfre het volgende: > > > > On Mon, Jul 30, 2012 at 9:32 AM, Gijs Molenaar 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. > > Ok, well then probably indeed it is best to do it this way. Probably it is better to confront the user with an exception than to implicitly change it's datatype anyway. Thanks for the help.
If you don't mind I have an other question, I hope you have the time to share your thoughts on this one also. I'm digging trough all the test cases and fixing them, but i'm a bit stuck on this one. test_forward_refs (modeltests.serializers.tests.JsonSerializerTransactionTestCase) fails in my case, generating a foreign key constrain violation. I've set supports_forward_references to False in features, but doesn't seem to have any effect. Do you have any interesting suggestion? Thanks! - Gijs -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/Rnp4jsc6K-IJ. 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.
