这个django应用程序使在django管理的更改列表中创建自定义过滤器变得更容易,并且还提供了treefilter和daterangefilter。
django-admin-filtrate的Python项目详细描述
##这个django应用程序使得在django管理员的更改列表中创建自定义过滤器变得更加容易,并且还提供了一个“treefilter”和一个“daterangefilter”。下面的se。
>在django 1.2.3和@15ea9a9 1.3.3.1上测试,从@15ea9a9 1.3.1.3.1开始测试。
我会写适当的文档,这里的事情越来越混乱,但这里是
lodowdowdowdown。
无法可靠地将django日期格式转换为
datepicker格式。所以这个提交引入了这两个新设置:
filtese={
改变你自己。
查看DatePicker文档以了解如何使用它们。
如本例所示:
class caseadmin(admin.modeladmin):
list_filter=['client']
def lookup_allowed(self,key,*args,**kwargs):
如果key中的'client_u start_date':
返回true
否则:
返回super(caseadmin,self)。lookup_allowed(key,*args,**kwargs)
35
时间和我的pythopython元fu都快用完了,我无法修复它
所以不需要定义一个空的media()类,如:
class cascaseaadmin(admin.modeladmin):
class media():
>pass
35;
添加对过滤器内容中的自定义HTML
,用于使用“media()”类。
tree filter
使用优秀库http://www.jstree.com/的递归树过滤器。
35 35 35 35 35 35 35
``python
/>
<
from filtese.filters导入treeffilter
from itertools import groupfrom itertools导入groupby
class companydepartmentfilter(treeffilter)class companydepartpartmentfilter(treeffilter):
field name=“client_u depuu department_u departuu id部门“
定义获取树(自身):
从company.models import department
qs=department.objects.all().order戥by('company戥order','company')
返回groupby(qs,lambda obj:getattr(obj,'company')
模型。
从filter import register戥filter
类案例(模型):
…
register戥filter(字段名,companydepartmentfilter)
…
````
35 35 35 35 35 35
````` python
```该过滤器。
br/>类caseLicenseStartDateFilter(DateRangeFilter):
字段名=“case license_u start_u date”
def get_u title(self):
返回“by license start date”
……
`````
35
*将repo和symlink复制或symlink文件夹“过滤”文件夹复制到apps文件夹。
*将“过滤”添加到已安装的apps文件夹。
*将“过滤”文件夹“过滤”添加到已安装的apps文件夹。
*将“过滤/模板”文件夹添加到模板文件夹。
框中运行。如果不是,则必须手动安装js和css文件。
有关“django.contrib.staticfiles”的详细信息,请访问
https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/。
>在django 1.2.3和@15ea9a9 1.3.3.1上测试,从@15ea9a9 1.3.1.3.1开始测试。
我会写适当的文档,这里的事情越来越混乱,但这里是
lodowdowdowdown。
无法可靠地将django日期格式转换为
datepicker格式。所以这个提交引入了这两个新设置:
filtese={
改变你自己。
查看DatePicker文档以了解如何使用它们。
如本例所示:
class caseadmin(admin.modeladmin):
list_filter=['client']
def lookup_allowed(self,key,*args,**kwargs):
如果key中的'client_u start_date':
返回true
否则:
返回super(caseadmin,self)。lookup_allowed(key,*args,**kwargs)
35
时间和我的pythopython元fu都快用完了,我无法修复它
所以不需要定义一个空的media()类,如:
class cascaseaadmin(admin.modeladmin):
class media():
>pass
35;
添加对过滤器内容中的自定义HTML
,用于使用“media()”类。
tree filter
使用优秀库http://www.jstree.com/的递归树过滤器。
35 35 35 35 35 35 35
``python
/>
<
from filtese.filters导入treeffilter
from itertools import groupfrom itertools导入groupby
class companydepartmentfilter(treeffilter)class companydepartpartmentfilter(treeffilter):
field name=“client_u depuu department_u departuu id部门“
定义获取树(自身):
从company.models import department
qs=department.objects.all().order戥by('company戥order','company')
返回groupby(qs,lambda obj:getattr(obj,'company')
模型。
从filter import register戥filter
类案例(模型):
…
register戥filter(字段名,companydepartmentfilter)
…
````
35 35 35 35 35 35
````` python
```该过滤器。
br/>类caseLicenseStartDateFilter(DateRangeFilter):
字段名=“case license_u start_u date”
def get_u title(self):
返回“by license start date”
……
`````
35
*将repo和symlink复制或symlink文件夹“过滤”文件夹复制到apps文件夹。
*将“过滤”添加到已安装的apps文件夹。
*将“过滤”文件夹“过滤”添加到已安装的apps文件夹。
*将“过滤/模板”文件夹添加到模板文件夹。
有关“django.contrib.staticfiles”的详细信息,请访问
https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/。