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

Тел: +7 965 3737 888

533

Просмотров

0

Ответов

Active User Sorted ModelAdmin

<p>Since r7806, the User field is unsorted which makes it harder to find specific users in the list if there is more than a few. This snippet is an django.contrib.admin.ModelAdmin subclass which searches through all of the fields on a form and automatically sorts fields which have a relation with User. It also filters on having active=True.</p>
<p>Just import the SortedActiveUserModelAdmin class in your admin.py and subclass your ModelAdmin classes from it instead of admin.ModelAdmin.</p>

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