Permalink
Browse files

Fixed deprecation warning about multilingual's ModelAdmin.

  • Loading branch information...
1 parent 29b75cc commit 0289ad4d34bb5c6f5faeb548c8cee27750057060 @svetlyak40wt svetlyak40wt committed Jun 10, 2009
Showing with 8 additions and 5 deletions.
  1. +8 −5 tagging/admin.py
View
@@ -7,6 +7,8 @@
admin.site.register(TaggedItem)
if settings.MULTILINGUAL_TAGS:
+ import multilingual
+
def _name(tag):
return tag.name_any
_name.short_description = _('name')
@@ -15,17 +17,18 @@ def _synonyms(tag):
return ', '.join(s.name for s in tag.synonyms.all())
_synonyms.short_description = _('synonyms')
- _fields = (_name, _synonyms)
+ class TagAdmin(multilingual.ModelAdmin):
+ list_display = (_name, _synonyms)
_synonym_tag_name = 'name_any'
else:
- _fields = ('name',)
+ class TagAdmin(admin.ModelAdmin):
+ list_display = ('name',)
_synonym_tag_name = 'name'
-admin.site.register(Tag,
- list_display = _fields,
-)
+
+admin.site.register(Tag, TagAdmin)
def _tag_name(synonym):
return '<a href="%s">%s</a>' % (

0 comments on commit 0289ad4

Please sign in to comment.