“Unlimited” precision is a natural semantic DecimalField(). Likewise, if we ever make max_length optional in CharField(), now providing it will mean “unlimited” length. (Scare quotes because storage is never really unlimited.)
I think we should provide the best API for our users and deal with the code. I’m in favor of not introducing another class and figuring out the least awful way to arrange the code paths in DecimalField. -- Aymeric. > On 20 juin 2015, at 23:40, Shai Berger <[email protected]> wrote: > > Hi, > > Django's DecimalField requires both max_digits and decimal_places. Database > backends allow them to be dropped, to specify an "unlimited precision" field. > Adding support for this in Django is probably not very helpful for new apps, > but can help significantly in using Django against legacy databases. I have > opened ticket #24920[1] to track this feature. > > I'm raising it here (at Tim's kind suggestion) because there's a bit of a > design decision to be made about implementing it: Supporting it in the > existing DecimalField class would lead to quite ugly code with repeated > branching on whether the attributes have values or not. It would be > significantly nicer to do this in a new field type. But that discrepancy > between > field type and database type would probably be a less-than-optimal public API. > > What do you think? > > Shai. > > > [1] https://code.djangoproject.com/ticket/24920 -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/910B673B-6B73-4A17-BEB8-4E7C05747CD1%40polytechnique.org. For more options, visit https://groups.google.com/d/optout.
