#31481: Admin crash when using functions in model meta ordering of o2o primary
key.
--------------------------------+--------------------------------------
Reporter: Gergely Kalmár | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Comment (by felixxm):
> Am I right that the patch is not released yet?
Yes, it's not released. It will be included in Django 3.1.
> Is there a workaround (besides patching Django locally) in the meantime?
You can move `ordering` to the `ExampleExtension`, e.g.
{{{
class ExampleExtension(models.Model):
...
class Meta:
ordering = [models.functions.Lower('example_object__some_field')]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31481#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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.0274f8baf6770a15d2c4bfc0f57d1677%40djangoproject.com.