Задать вопрос

Тел: +7 965 3737 888

407

Просмотров

2

Ответов

FilterSpec for ForeignKeys to auth.User with HTML input tag for ModelAdmin.list_filter

I often need to filter my change_list by author but my User table is usually pretty crowded and adding the User FK to list_filter would end up with hundreds of user links in the sidebar. This snippets replace those hundreds of links by a simple HTML <input>.

Вопрос полезен? Да0/Нет0
file_5182.py(3.4Кб)
None

Ответы (2):

Ответzaan:28.08.2011
Ответ полезен? Да0/Нет0

I just can't make it work. Could you write a short instruction, where should be placed particular parts of that code?

Ответjazzuell:03.07.2011
Ответ полезен? Да0/Нет0

I think that this is a good idea, because Django doesn't support multiple search fields and my filter field is toooo long. Thank you for your work. Can you please show us something more universal and maybe not with RelatedFilterSpec but with AllValuesFilterSpec. Im trying use it in my own admin, but you didn't shown us your models.py so it is difficuilt to change code for my needs. It should be easy to do it, but I am just a newbie. Thank you.