On Thu, 2014-12-04 at 18:04 -0800, Josh Smeaton wrote:

> 
> I've implemented https://github.com/django/django/pull/3655/ which
> effectively ignores the max_digits and decimal_places arguments in the
> base expression class. Subclasses are free to enforce validation if it
> is necessary. Further, callers using aren't required to supply bounds
> checking in this situation.

It seems wrong to throw away constraints the user has explicitly set.
So, if you say:
   
    .annotate(sum_age=Sum('age', output_field=DecimalField(max_digits=3)))

then it seems that the max_digits should really be 3.

So, if the user explicitly asks for max_digits=3 in the output_field
argument, then we should enforce that. Or, alternatively we should
disallow setting max_digits for explicit output_field in expressions.
But just throwing away the value the user has explicitly set is wrong.

 - Anssi

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/1417760145.22478.72.camel%40TTY32.
For more options, visit https://groups.google.com/d/optout.

Reply via email to