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 12455,admin_order_field for Admin list_display not working for callable,Kegan Gan,Brian Rosner,"In the Admin, when using [http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display list_display], we should be able to make a sort callable if it is associated with certain database field through the use of attribute ''admin_order_field''. Example: {{{ def submitted_date(self, obj): return obj.created_at.strftime('%d %b %Y') submitted_date.short_description = 'Submitted Date' submitted_date.admin_order_field = 'created_at' }}} ''NOTE: created_at is a DB field in the model.'' This is currently not working. Searching through the code, I believe the bug is located in [http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templatetags/admin_list.py?rev=11965#L75 the following Django code]. The ''attr'' variable seems will always be ''None''.",,closed,contrib.admin,dev,,fixed,list_display admin_order_field,ramusus@…,Accepted,0,0,0,0,0,0