filters in admin

16 views
Skip to first unread message

jws

unread,
Jul 30, 2006, 12:46:10 AM7/30/06
to Django users
Is it currently possible to create filters in the admin interface that
limit the displayed items by a criteria applied to a datefield?

As an example, if a user model has datefields to indicate start and end
dates of their site membership, I'd like to create a filter to only
show 'current members'. The actual criteria would be where the end
date of their membership > today.

I suppose more generally, it would be nice to be able to create any
sort of filter that could be described using the database API.

Adrian Holovaty

unread,
Aug 3, 2006, 10:24:43 AM8/3/06
to django...@googlegroups.com
On 7/29/06, jws <jsack...@gmail.com> wrote:
> Is it currently possible to create filters in the admin interface that
> limit the displayed items by a criteria applied to a datefield?

It's not possible at the moment to create custom filters, but this is
on the to-do list for the (figurative) version 2.0 of the admin site.
In the mean time, you can add "&end_date__lt=2006-08-03" to the URL of
the changelist page, and the objects will filter. The query string
accepts any lookup-style argument that the database API uses.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

Reply all
Reply to author
Forward
0 new messages