Hey all,

A few questions about sorting fields with automatically generated
Django admin pages.
1. When you want to sort by a field generated by a function, is it
possible to have it sort both ascending and descending?

I have a column called name, which is populated by a function that
appends first_name and last_name. I added the attribute
admin_order_field = 'last_name' to the name function. However, it only
sorts it one direction (descending).

2. Is it possible to add sorting for foreign keys?

I have a foreign key called role that displays properly. I also tried
creating a dummy function called sortableRole that used a notation
similar to search_fields: admin_order_field = 'role__name'. I'm
guessing this functionality isn't built into Django yet.

Any help would be greatly appreciated.

Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to