#361: Some Basic Math Filters
---------------------------------+--------------------------------------
     Reporter:  ilikeprivacy@…   |                    Owner:  adrian
         Type:  defect           |                   Status:  closed
    Component:  Template system  |                  Version:
     Severity:  normal           |               Resolution:  wontfix
     Keywords:  filter math      |             Triage Stage:  Unreviewed
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------

Comment (by foxwhisper):

 Today I found the need for having math filters in the template,
 specifically for visualization (changing 0.01PPM into 1p) which is not
 business logic but indeed template logic.

 Just as I was about to add a comment saying "omfg why doesn't Django
 support this", I realized why the core devs are rejecting this. And the
 simple reason is, it would get abused like crazy and it's would be a
 slippery path to failure. Sure it would be useful for sane developers on
 specific use cases, but it would be abused by the majority.

 Although Adam makes a good point with this comment:

 {{{
 It up to them to decide if they want to "bastardise" their application by
 putting application logic into the view, not the framework.
 }}}

 dloewenherz also makes another good point:

 {{{
 "add" is a filter, yet none of the other basic math operations are. This
 seems a little inconsistent to me.
 }}}

 Could a core developer perhaps explain what the reasoning was behind
 having add, but not any of the others?? I had a look around the archives,
 but couldn't seem to find any justification for this. It seems to me that
 we should either have all of them, or none at all??

 It seems this topic hits a nerve with a lot of people, so if a core dev is
 able to give some answers on the above, we will finally be able to put
 this issue to rest with a concrete justification.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/361#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en.

Reply via email to