# Path: catalog/settings.py
# DATETIME_INPUT_FOMRAT = '%Y-%m-%d %H:%M:%S'
# DATE_INPUT_FOMRAT = '%Y-%m-%d'
# SLUG_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
#     'and can\'t start with a digit.')
# UNDERSCORE_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits and underscores, '
#     'and can\'t start with a digit.')
# ACTIVE_FIELD_HELP_TEXT = _(
#     'Is this object active? You can hide it by unchecking this box.')
# PRODUCT_CHANGE_FORM_TEMPLATE = (
#     'admin/catalog/product_change_form.html')
# ATTRIBUTE_TEMPLATE_CHOICES = getattr(
#     settings, 'CATALOG_ATTRIBUTE_TEMPLATE_CHOICES', (
#         ('radio', _('Radio')),
#     ))
# RELATED_PRODUCT_KIND_CHOICES = getattr(
#     settings, 'CATALOG_RELATED_PRODUCT_KIND_CHOICES', (
#         ('upsell', _('Upsell')),
#         ('cross_sell', _('Cross sell')),
#     ))
# PRODUCTS_PER_PAGE = getattr(settings, 'CATALOG_PRODUCTS_PER_PAGE', 6)
# HAS_CATEGORIES = getattr(settings, 'CATALOG_HAS_CATEGORIES', True)
# HAS_BRANDS = getattr(settings, 'CATALOG_HAS_BRANDS', True)
# HAS_MANUFACTURERS = getattr(settings, 'CATALOG_HAS_MANUFACTURERS', True)
# HAS_MODIFIER_CODES = getattr(settings, 'CATALOG_HAS_MODIFIER_CODES', True)
# PRODUCT_URL = getattr(
#     settings, 'CATALOG_PRODUCT_URL', 'products')
# CATEGORY_URL = getattr(
#     settings, 'CATALOG_CATEGORY_URL', 'categories')
# BRAND_URL = getattr(
#     settings, 'CATALOG_BRAND_URL', 'brands')
# MANUFACTURER_URL = getattr(
#     settings, 'CATALOG_MANUFACTURER_URL', 'manufacturers')
# MEASUREMENT_UNITS = getattr(settings, 'CATALOG_MEASUREMENT_UNITS', [])
# MODIFIER_CONDITIONS = getattr(settings, 'CATALOG_MODIFIER_CONDITIONS', [
#     'catalog.modifier_conditions.PriceGreaterThanModifierCondition',
#     'catalog.modifier_conditions.PriceLessThanModifierCondition',
#     'catalog.modifier_conditions.QuantityGreaterThanModifierCondition',
#     'catalog.modifier_conditions.QuantityLessThanModifierCondition',
#     'catalog.modifier_conditions.WidthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WidthLessThanModifierCondition',
#     'catalog.modifier_conditions.HeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.HeightLessThanModifierCondition',
#     'catalog.modifier_conditions.DepthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.DepthLessThanModifierCondition',
#     'catalog.modifier_conditions.WeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WeightLessThanModifierCondition',
# ])


from django.db import models
from django.core.validators import RegexValidator
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from shop.addressmodel.models import USER_MODEL
from catalog import settings as scs
class Region(models.Model):
    code = models.SlugField(
        _('Code'), max_length=128, unique=True, db_index=True)
    name = models.CharField(_('Name'), max_length=255)
    active = models.BooleanField(
        _('Active'), default=True, help_text=scs.ACTIVE_FIELD_HELP_TEXT)

    class Meta:
        db_table = 'catalog_addresses_regions'
        verbose_name = _('Region')
        verbose_name_plural = _('Regions')
        ordering = ('name', )

    def __str__(self):
        return '{}'.format(self.name)


@python_2_unicode_compatible
class Country(models.Model):
    region = models.ForeignKey(
        Region, related_name='countries', verbose_name=_('Region'),
        help_text=_('Select a region for this country. This is mostly used to '
                    'define shipping rates per region.'))

    code = models.SlugField(
        _('Code'), max_length=2, unique=True, db_index=True,
        help_text=_('A 2 letter country code.'))

    name = models.CharField(_('Name'), max_length=255)
    active = models.BooleanField(

# Path: catalog/settings.py
# DATETIME_INPUT_FOMRAT = '%Y-%m-%d %H:%M:%S'
# DATE_INPUT_FOMRAT = '%Y-%m-%d'
# SLUG_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
#     'and can\'t start with a digit.')
# UNDERSCORE_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits and underscores, '
#     'and can\'t start with a digit.')
# ACTIVE_FIELD_HELP_TEXT = _(
#     'Is this object active? You can hide it by unchecking this box.')
# PRODUCT_CHANGE_FORM_TEMPLATE = (
#     'admin/catalog/product_change_form.html')
# ATTRIBUTE_TEMPLATE_CHOICES = getattr(
#     settings, 'CATALOG_ATTRIBUTE_TEMPLATE_CHOICES', (
#         ('radio', _('Radio')),
#     ))
# RELATED_PRODUCT_KIND_CHOICES = getattr(
#     settings, 'CATALOG_RELATED_PRODUCT_KIND_CHOICES', (
#         ('upsell', _('Upsell')),
#         ('cross_sell', _('Cross sell')),
#     ))
# PRODUCTS_PER_PAGE = getattr(settings, 'CATALOG_PRODUCTS_PER_PAGE', 6)
# HAS_CATEGORIES = getattr(settings, 'CATALOG_HAS_CATEGORIES', True)
# HAS_BRANDS = getattr(settings, 'CATALOG_HAS_BRANDS', True)
# HAS_MANUFACTURERS = getattr(settings, 'CATALOG_HAS_MANUFACTURERS', True)
# HAS_MODIFIER_CODES = getattr(settings, 'CATALOG_HAS_MODIFIER_CODES', True)
# PRODUCT_URL = getattr(
#     settings, 'CATALOG_PRODUCT_URL', 'products')
# CATEGORY_URL = getattr(
#     settings, 'CATALOG_CATEGORY_URL', 'categories')
# BRAND_URL = getattr(
#     settings, 'CATALOG_BRAND_URL', 'brands')
# MANUFACTURER_URL = getattr(
#     settings, 'CATALOG_MANUFACTURER_URL', 'manufacturers')
# MEASUREMENT_UNITS = getattr(settings, 'CATALOG_MEASUREMENT_UNITS', [])
# MODIFIER_CONDITIONS = getattr(settings, 'CATALOG_MODIFIER_CONDITIONS', [
#     'catalog.modifier_conditions.PriceGreaterThanModifierCondition',
#     'catalog.modifier_conditions.PriceLessThanModifierCondition',
#     'catalog.modifier_conditions.QuantityGreaterThanModifierCondition',
#     'catalog.modifier_conditions.QuantityLessThanModifierCondition',
#     'catalog.modifier_conditions.WidthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WidthLessThanModifierCondition',
#     'catalog.modifier_conditions.HeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.HeightLessThanModifierCondition',
#     'catalog.modifier_conditions.DepthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.DepthLessThanModifierCondition',
#     'catalog.modifier_conditions.WeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WeightLessThanModifierCondition',
# ])


# Path: catalog/addresses/models.py
from django.db import models
from django.core.validators import RegexValidator
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from shop.addressmodel.models import USER_MODEL
from catalog import settings as scs

class Region(models.Model):
    code = models.SlugField(
        _('Code'), max_length=128, unique=True, db_index=True)
    name = models.CharField(_('Name'), max_length=255)
    active = models.BooleanField(
        _('Active'), default=True, help_text=scs.ACTIVE_FIELD_HELP_TEXT)

    class Meta:
        db_table = 'catalog_addresses_regions'
        verbose_name = _('Region')
        verbose_name_plural = _('Regions')
        ordering = ('name', )

    def __str__(self):
        return '{}'.format(self.name)


@python_2_unicode_compatible
class Country(models.Model):
    region = models.ForeignKey(
        Region, related_name='countries', verbose_name=_('Region'),
        help_text=_('Select a region for this country. This is mostly used to '
                    'define shipping rates per region.'))

    code = models.SlugField(
        _('Code'), max_length=2, unique=True, db_index=True,
        help_text=_('A 2 letter country code.'))

    name = models.CharField(_('Name'), max_length=255)
    active = models.BooleanField(

        _('Active'), default=True, help_text=scs.ACTIVE_FIELD_HELP_TEXT)