Home | Trees | Indices | Help |
|
---|
|
1 """CategoryAdmin for Zinnia""" 2 from django.contrib import admin 3 from django.core.urlresolvers import NoReverseMatch 4 from django.utils.translation import ugettext_lazy as _ 5 6 from zinnia.admin.forms import CategoryAdminForm 7 810 """Admin for Category model""" 11 form = CategoryAdminForm 12 fields = ('title', 'parent', 'description', 'slug') 13 list_display = ('title', 'slug', 'get_tree_path', 'description') 14 prepopulated_fields = {'slug': ('title', )} 15 search_fields = ('title', 'description') 16 list_filter = ('parent',) 17 213123 """Return the category's tree path in HTML""" 24 try: 25 return '<a href="%s" target="blank">/%s/</a>' % \ 26 (category.get_absolute_url(), category.tree_path) 27 except NoReverseMatch: 28 return '/%s/' % category.tree_path29 get_tree_path.allow_tags = True 30 get_tree_path.short_description = _('tree path')
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Feb 22 09:38:54 2011 | http://epydoc.sourceforge.net |