如何在Django 1.4中自定义管理过滤器 [英] How to customize admin filter in Django 1.4
问题描述
自定义过滤器Django管理员Django 1.3或更低版本
我尝试阅读'django.contrib.admin'应用程序中的过滤器模块的源代码,但不幸的是我很难理解代码背后的理由。所以我想知道有没有人可以提供一些例子或引用这个问题---如何在Django 1.4中自定义管理过滤器?
提前感谢! >
在v1.4中引入了新的django.contrib.admin.SimpleListFilter,满足您的需要,官方文档提供了示例代码,读。
在本节中搜索SimpleListFilter 。
I am a newbie in Python and Django Development, I learned a lot from the easy read examples provided by the community. But recently I want to implement a customized admin filter for the admin console shipped with Django. I searched a lot and only found some out-of-date approaches to get it done. Such as: Custom Filter in Django Admin on Django 1.3 or below
I tried to read the source code for the filters module in 'django.contrib.admin' app, but unfortunately I can hardly understand the rationale behind the codes. So I wonder whether some kind people could supply some examples or references to this issue --- How to customize admin filter in Django 1.4 ?
Thanks in advance!
There is new django.contrib.admin.SimpleListFilter introduced in v1.4 meet your need, and official document provide sample code and easy to read. search SimpleListFilter in this section.
这篇关于如何在Django 1.4中自定义管理过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!