Skip to content

Commit

Permalink
update tag extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Baechler committed Aug 7, 2014
1 parent 4d85887 commit e1f49aa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions elephantblog/extensions/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
from django.utils.translation import ugettext_lazy as _

from taggit.managers import TaggableManager
from feincms.extensions import Extension as FeincmsExtension


def register(cls, admin_cls):
cls.add_to_class('tags', TaggableManager(
help_text=_('A comma-separated list of tags.'), blank=True))
class Extension(FeincmsExtension):

if admin_cls:
if hasattr(admin_cls, 'add_extension_options'):
admin_cls.add_extension_options('tags')
def handle_model(self):
self.model.add_to_class('tags', TaggableManager(
help_text=_('A comma-separated list of tags.'), blank=True))

def handle_modeladmin(self, modeladmin):
if hasattr(modeladmin, 'add_extension_options'):
modeladmin.add_extension_options('tags')

0 comments on commit e1f49aa

Please sign in to comment.