# Path: cmsplugin_shop/utils.py
# def get_form(name):
#     return import_string(getattr(settings.settings,
#         'CMSPLUGIN_SHOP_{}_FORM'.format(name.upper()),
#         'cmsplugin_shop.forms.{}Form'.format(name),
#     ))
# 
# def get_admin(name):
#     return import_string(getattr(settings.settings,
#         'CMSPLUGIN_SHOP_{}_ADMIN'.format(name.upper()),
#         'cmsplugin_shop.admins.{}Admin'.format(name),
#     ))


from django.conf import settings
from django.contrib import admin
from django.contrib.admin.util import get_model_from_relation
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_text, force_text
from django.utils.translation import ugettext_lazy as _
from django_mptt_admin.admin import DjangoMpttAdmin
from mptt.models import TreeForeignKey
from cms.utils import get_language_from_request
from . import models
from .utils import get_form, get_admin
        from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
                        self.lookup_kwarg_isnull,
            ]),
            'display': _('All'),
        }
        for val in self.lookup_choices:
            yield {
                'selected': self.lookup_val_lft == val.lft and self.lookup_val_rght == val.rght,
                'query_string': cl.get_query_string({
                    self.lookup_kwarg_tid:  val.tree_id,
                    self.lookup_kwarg_lft:  val.lft,
                    self.lookup_kwarg_rght: val.rght,
                }, [self.lookup_kwarg_isnull]),
                'display': '{}{}'.format(val.level*'- ', val),
            }
        if self.field.null:
            yield {
                'selected': bool(self.lookup_val_isnull),
                'query_string': cl.get_query_string({
                    self.lookup_kwarg_isnull: 'True',
                }, [
                    self.lookup_kwarg_tid,
                    self.lookup_kwarg_lft,
                    self.lookup_kwarg_rght,
                ]),
                'display': EMPTY_CHANGELIST_VALUE,
            }



class CategoryAdmin(admin.ModelAdmin):

# Path: cmsplugin_shop/utils.py
# def get_form(name):
#     return import_string(getattr(settings.settings,
#         'CMSPLUGIN_SHOP_{}_FORM'.format(name.upper()),
#         'cmsplugin_shop.forms.{}Form'.format(name),
#     ))
# 
# def get_admin(name):
#     return import_string(getattr(settings.settings,
#         'CMSPLUGIN_SHOP_{}_ADMIN'.format(name.upper()),
#         'cmsplugin_shop.admins.{}Admin'.format(name),
#     ))


# Path: cmsplugin_shop/admins.py
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.util import get_model_from_relation
from django.core.urlresolvers import reverse
from django.utils.encoding import smart_text, force_text
from django.utils.translation import ugettext_lazy as _
from django_mptt_admin.admin import DjangoMpttAdmin
from mptt.models import TreeForeignKey
from cms.utils import get_language_from_request
from . import models
from .utils import get_form, get_admin
        from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE

                        self.lookup_kwarg_isnull,
            ]),
            'display': _('All'),
        }
        for val in self.lookup_choices:
            yield {
                'selected': self.lookup_val_lft == val.lft and self.lookup_val_rght == val.rght,
                'query_string': cl.get_query_string({
                    self.lookup_kwarg_tid:  val.tree_id,
                    self.lookup_kwarg_lft:  val.lft,
                    self.lookup_kwarg_rght: val.rght,
                }, [self.lookup_kwarg_isnull]),
                'display': '{}{}'.format(val.level*'- ', val),
            }
        if self.field.null:
            yield {
                'selected': bool(self.lookup_val_isnull),
                'query_string': cl.get_query_string({
                    self.lookup_kwarg_isnull: 'True',
                }, [
                    self.lookup_kwarg_tid,
                    self.lookup_kwarg_lft,
                    self.lookup_kwarg_rght,
                ]),
                'display': EMPTY_CHANGELIST_VALUE,
            }



class CategoryAdmin(admin.ModelAdmin):

    form            = get_form('Category')