from __future__ import absolute_import, unicode_literals

from django.utils.translation import ugettext_lazy as _

from taggit.managers import TaggableManager


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

    if admin_cls:
        if hasattr(admin_cls, 'add_extension_options'):
            admin_cls.add_extension_options('tags')

from __future__ import absolute_import, unicode_literals

from django.utils.translation import ugettext_lazy as _

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


class Extension(FeincmsExtension):

    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')

update tag extension