#29893: Unexpected behavior of DetailView on a model defining __len__() 
returning
False
-------------------------------+--------------------------------------
     Reporter:  Max            |                    Owner:  Max
         Type:  Bug            |                   Status:  assigned
    Component:  Generic views  |                  Version:  2.1
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by Max):

 I agree that the case of having __len__ defined on a model may be rare,
 but i would strongly propose doing the modification of this check.
 Although this may not be exhaustive (you mentioned cases like
 {{{self.instance}}}), i think it is worth it, because the current
 situation leads to highly unexpected behavior, which can be definitely
 avoided in this particular case.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29893#comment:3>
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 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.3ef7003dcbd4a64ae0393a52bc303028%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to