Opened 3 years ago

Last modified 2 years ago

#18736 new New feature

Flexible filters for django admin

Reported by: MagnusGraviti Owned by: nobody
Component: contrib.admin Version: 1.4
Severity: Normal Keywords:
Cc: schillingt@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

Current django admin filters allow us to make predefined actions without any parameters be entered by user.

It would be nice to give more flexibility. I mean filters with inputs, OR, >, <, >=, <= which should allow users to make more precise filtering. Here we need also a designer.

I'd like to code it for Django project :) Assuming it will be my first huge open source effort it would be great to have supervisor to ask my questions.

best regards,
Olexandr Shalakhin

Change History (4)

comment:1 Changed 3 years ago by tswicegood

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed
  • Type changed from Uncategorized to New feature

Thanks for kicking off the discussion on this. It definitely sounds interesting, but it's probably too early for this to be in Trac. There are other people who are driving the admin work forward, namely Idan and Julien. Your best bet is to try to grab them on IRC or email the django-developers and describe what it is you've got planned and how you'd like to tackle it. You can also take a stab at this and offer patches -- it's definitely easier to grok what you're suggesting when we can look at code.

comment:2 Changed 3 years ago by MagnusGraviti

Thanks! I'll discuss it with them. I am also reading the django admin code so I think I'll find initial approach to do it. Let's do it :)

comment:3 Changed 3 years ago by julien

  • Triage Stage changed from Design decision needed to Accepted
  • UI/UX set

This sounds like a good idea.

comment:4 Changed 2 years ago by CodenameTim

  • Cc schillingt@… added

I took a stab at implementing this. I ended up creating a new filter class ComparisonFieldListFilter. When using it we'll need to pass in the value to compare the field to. The easiest way (that I saw) to support this was to use a nested tuple.

list_filter = [(('rank', 50), admin.ComparisonFieldListFilter), ]

I'm assume that my code will need some modifications, so let me know what I need to change or clean up. This is just a starting point.

Commit: https://github.com/tim-schilling/django/commit/cf7138d0a5953f0b2d707de944f715f0cfdaba64

Note: See TracTickets for help on using tickets.
Back to Top