# Path: shopkit/category/settings.py
# CATEGORY_MODEL = getattr(settings, 'SHOPKIT_CATEGORY_MODEL')
# 
# Path: shopkit/category/settings.py
# USE_MPTT = getattr(
#     settings, 'SHOPKIT_USE_MPTT', 'mptt' in settings.INSTALLED_APPS)


import logging
from django.utils.translation import ugettext_lazy as _
from django.db import models
from shopkit.category.settings import CATEGORY_MODEL
from shopkit.category.settings import USE_MPTT
        from shopkit.core.settings import PRODUCT_MODEL
        from shopkit.core.utils import get_model_from_string
        from shopkit.core.settings import PRODUCT_MODEL
        from shopkit.core.utils import get_model_from_string
    from mptt.models import MPTTModel
    from mptt.managers import TreeManager
            from shopkit.core.settings import PRODUCT_MODEL
            from shopkit.core.utils import get_model_from_string
    @classmethod
    def get_main_categories(cls):
        """
        Gets the main categories, which for unnested categories
        implies all of them. This method exists purely for uniformity
        reasons.
        """

        categories = cls.get_categories()

        return categories


    def get_products(self):
        """ Get all active products for the current category.
        """

        product_class = get_model_from_string(PRODUCT_MODEL)

        return product_class.in_shop.filter(category=self)


class NestedCategoryBase(CategoryBase):
    """
    Abstract base class for a nested category.
    """

    class Meta(CategoryBase.Meta):
        abstract = True


# Path: shopkit/category/settings.py
# CATEGORY_MODEL = getattr(settings, 'SHOPKIT_CATEGORY_MODEL')
# 
# Path: shopkit/category/settings.py
# USE_MPTT = getattr(
#     settings, 'SHOPKIT_USE_MPTT', 'mptt' in settings.INSTALLED_APPS)


# Path: shopkit/category/basemodels.py
import logging
from django.utils.translation import ugettext_lazy as _
from django.db import models
from shopkit.category.settings import CATEGORY_MODEL
from shopkit.category.settings import USE_MPTT
        from shopkit.core.settings import PRODUCT_MODEL
        from shopkit.core.utils import get_model_from_string
        from shopkit.core.settings import PRODUCT_MODEL
        from shopkit.core.utils import get_model_from_string
    from mptt.models import MPTTModel
    from mptt.managers import TreeManager
            from shopkit.core.settings import PRODUCT_MODEL
            from shopkit.core.utils import get_model_from_string

    @classmethod
    def get_main_categories(cls):
        """
        Gets the main categories, which for unnested categories
        implies all of them. This method exists purely for uniformity
        reasons.
        """

        categories = cls.get_categories()

        return categories


    def get_products(self):
        """ Get all active products for the current category.
        """

        product_class = get_model_from_string(PRODUCT_MODEL)

        return product_class.in_shop.filter(category=self)


class NestedCategoryBase(CategoryBase):
    """
    Abstract base class for a nested category.
    """

    class Meta(CategoryBase.Meta):
        abstract = True


    parent = models.ForeignKey(CATEGORY_MODEL, null=True, blank=True,