#30557: order_by() a parent model crash when Meta.ordering contains expressions.
-------------------------------------+-------------------------------------
     Reporter:  Jonny Fuller         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ordering             |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by getup8):

 I *think* I'm getting a similar (or same) error when adding lowercased
 ordering to a model via meta:

 {{{
 class Recipe(models.Model):
     # ...
     class Meta:
         ordering = (Lower('name'),)
 }}}

 This works fine in normal views (listing out recipes for instance), but in
 the admin, I get the following error:
 `'Lower' object is not subscriptable`

 which also comes via `get_order_dir()`

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30557#comment:4>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.2e1204f94576837bee5bd56ea685775a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to