[contrib.admin] : search by date according to localization.
28 views
Skip to first unread message
Stan
unread,
Jul 4, 2012, 10:41:14 AM7/4/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
The way the query is constructed in admin.changelist to filter according the search parameters is very basic. There is no assumptions and no verifications done on the fields, it is just a string naively constructed from ModelAdmin.search_fields. I am using it to allow one to search by date in a related model (since ModelAdmin.date_hierarchy does not accept a date field in a related) but the date format must be YY-MM-DD whatever is your localization, which is too bad.