﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29428	Add support to admin for expressions like (Lower('myfield'),) in model Meta.ordering	Dutch Stiphout	Tim Graham <timograham@…>	"Similar to ticket #26257.

This DOES WORK in the views I've written, but when I try to access /admin/balfor/scheduledtransaction/ I get the same error as in the referenced ticket:

(Note that my app name is balfor, running Django version 2.0.4 final)

{{{
AttributeError at /admin/balfor/scheduledtransaction/
'Lower' object has no attribute 'startswith'
}}}

models.py:
{{{
from django.db import models
from django.db.models.functions import Lower

class ScheduledTransaction(models.Model):
    description = models.CharField(max_length=50, default=""New Scheduled Transaction"")
    period = models.CharField(max_length=2, default=""1S"")

    class Meta:
        ordering = ['period', Lower('description')]
}}}

admin.py:
{{{
admin.site.register(ScheduledTransaction)
}}}
"	Bug	closed	contrib.admin	2.0	Release blocker	fixed	admin ordering expression AttributeError	Mariusz Felisiak Carlton Gibson	Ready for checkin	1	0	0	0	0	0
