Пример #1
0
"""
Vanilla product models
"""
from izi.apps.catalogue.abstract_models import *  # noqa
from izi.core.loading import is_model_registered

__all__ = ['ProductAttributesContainer']

if not is_model_registered('catalogue', 'ProductClass'):

    class ProductClass(AbstractProductClass):
        pass

    __all__.append('ProductClass')

if not is_model_registered('catalogue', 'Category'):

    class Category(AbstractCategory):
        pass

    __all__.append('Category')

if not is_model_registered('catalogue', 'ProductCategory'):

    class ProductCategory(AbstractProductCategory):
        pass

    __all__.append('ProductCategory')

if not is_model_registered('catalogue', 'Product'):
Пример #2
0
from izi.apps.basket.abstract_models import (
    AbstractBasket, AbstractLine, AbstractLineAttribute)
from izi.core.loading import is_model_registered

__all__ = [
    'InvalidBasketLineError',
]


class InvalidBasketLineError(Exception):
    pass


if not is_model_registered('basket', 'Basket'):
    class Basket(AbstractBasket):
        pass

    __all__.append('Basket')


if not is_model_registered('basket', 'Line'):
    class Line(AbstractLine):
        pass

    __all__.append('Line')


if not is_model_registered('basket', 'LineAttribute'):
    class LineAttribute(AbstractLineAttribute):
        pass
Пример #3
0
from izi.core.loading import is_model_registered

from izi_accounts import abstract_models

if not is_model_registered('izi_accounts', 'AccountType'):

    class AccountType(abstract_models.AccountType):
        pass


if not is_model_registered('izi_accounts', 'Account'):

    class Account(abstract_models.Account):
        pass


if not is_model_registered('izi_accounts', 'Transfer'):

    class Transfer(abstract_models.Transfer):
        pass


if not is_model_registered('izi_accounts', 'Transaction'):

    class Transaction(abstract_models.Transaction):
        pass


if not is_model_registered('izi_accounts', 'IPAddressRecord'):

    class IPAddressRecord(abstract_models.IPAddressRecord):
Пример #4
0
from izi.apps.address.abstract_models import AbstractPartnerAddress
from izi.apps.partner.abstract_models import (
    AbstractPartner, AbstractStockAlert, AbstractStockRecord)
from izi.core.loading import is_model_registered

__all__ = []


if not is_model_registered('partner', 'Partner'):
    class Partner(AbstractPartner):
        pass

    __all__.append('Partner')


if not is_model_registered('partner', 'PartnerAddress'):
    class PartnerAddress(AbstractPartnerAddress):
        pass

    __all__.append('PartnerAddress')


if not is_model_registered('partner', 'StockRecord'):
    class StockRecord(AbstractStockRecord):
        pass

    __all__.append('StockRecord')


if not is_model_registered('partner', 'StockAlert'):
    class StockAlert(AbstractStockAlert):
Пример #5
0
from izi.apps.analytics.abstract_models import (AbstractProductRecord,
                                                AbstractUserProductView,
                                                AbstractUserRecord,
                                                AbstractUserSearch)
from izi.core.loading import is_model_registered

__all__ = []

if not is_model_registered('analytics', 'ProductRecord'):

    class ProductRecord(AbstractProductRecord):
        pass

    __all__.append('ProductRecord')

if not is_model_registered('analytics', 'UserRecord'):

    class UserRecord(AbstractUserRecord):
        pass

    __all__.append('UserRecord')

if not is_model_registered('analytics', 'UserProductView'):

    class UserProductView(AbstractUserProductView):
        pass

    __all__.append('UserProductView')

if not is_model_registered('analytics', 'UserSearch'):
Пример #6
0
from izi.core.loading import is_model_registered

from izi_invoices import app_settings
from izi_invoices.abstract_models import AbstractInvoice, AbstractLegalEntity, AbstractLegalEntityAddress

__all__ = []

is_custom_invoice_model = app_settings.IZI_INVOICES_INVOICE_MODEL != 'izi_invoices.Invoice'

if not is_model_registered('izi_invoices',
                           'Invoice') and not is_custom_invoice_model:

    class Invoice(AbstractInvoice):
        pass

    __all__.append('Invoice')

if not is_model_registered('izi_invoices', 'LegalEntity'):

    class LegalEntity(AbstractLegalEntity):
        pass

    __all__.append('LegalEntity')

if not is_model_registered('izi_invoices', 'LegalEntityAddress'):

    class LegalEntityAddress(AbstractLegalEntityAddress):
        pass

    __all__.append('LegalEntityAddress')
Пример #7
0
from izi.apps.address.abstract_models import (AbstractBillingAddress,
                                              AbstractShippingAddress)
from izi.apps.order.abstract_models import *  # noqa
from izi.core.loading import is_model_registered

__all__ = ['PaymentEventQuantity', 'ShippingEventQuantity']

if not is_model_registered('order', 'Order'):

    class Order(AbstractOrder):
        pass

    __all__.append('Order')

if not is_model_registered('order', 'OrderNote'):

    class OrderNote(AbstractOrderNote):
        pass

    __all__.append('OrderNote')

if not is_model_registered('order', 'CommunicationEvent'):

    class CommunicationEvent(AbstractCommunicationEvent):
        pass

    __all__.append('CommunicationEvent')

if not is_model_registered('order', 'ShippingAddress'):

    class ShippingAddress(AbstractShippingAddress):
Пример #8
0
# -*- coding: utf-8 -*-
from izi.core.loading import is_model_registered

from .abstract_models import *  # noqa

__all__ = []

if not is_model_registered('wishlists', 'WishList'):

    class WishList(AbstractWishList):
        pass

    __all__.append('WishList')

if not is_model_registered('wishlists', 'Line'):

    class Line(AbstractLine):
        pass

    __all__.append('Line')
Пример #9
0
from izi.apps.voucher.abstract_models import (AbstractVoucher,
                                              AbstractVoucherApplication,
                                              AbstractVoucherSet)
from izi.core.loading import is_model_registered

__all__ = []

if not is_model_registered('voucher', 'VoucherSet'):

    class VoucherSet(AbstractVoucherSet):
        pass

    __all__.append('VoucherSet')

if not is_model_registered('voucher', 'Voucher'):

    class Voucher(AbstractVoucher):
        pass

    __all__.append('Voucher')

if not is_model_registered('voucher', 'VoucherApplication'):

    class VoucherApplication(AbstractVoucherApplication):
        pass

    __all__.append('VoucherApplication')
Пример #10
0
from izi.apps.shipping import abstract_models
from izi.core.loading import is_model_registered

__all__ = []

if not is_model_registered('shipping', 'OrderAndItemCharges'):

    class OrderAndItemCharges(abstract_models.AbstractOrderAndItemCharges):
        pass

    __all__.append('OrderAndItemCharges')

if not is_model_registered('shipping', 'WeightBased'):

    class WeightBased(abstract_models.AbstractWeightBased):
        pass

    __all__.append('WeightBased')

if not is_model_registered('shipping', 'WeightBand'):

    class WeightBand(abstract_models.AbstractWeightBand):
        pass

    __all__.append('WeightBand')
Пример #11
0
from izi.core.loading import is_model_registered

from . import abstract_models

__all__ = []

if not is_model_registered('payment', 'Transaction'):

    class Transaction(abstract_models.AbstractTransaction):
        pass

    __all__.append('Transaction')

if not is_model_registered('payment', 'Source'):

    class Source(abstract_models.AbstractSource):
        pass

    __all__.append('Source')

if not is_model_registered('payment', 'SourceType'):

    class SourceType(abstract_models.AbstractSourceType):
        pass

    __all__.append('SourceType')

if not is_model_registered('payment', 'Bankcard'):

    class Bankcard(abstract_models.AbstractBankcard):
        pass
Пример #12
0
from izi.apps.customer import abstract_models
from izi.core.loading import is_model_registered

__all__ = []


if not is_model_registered('customer', 'Email'):
    class Email(abstract_models.AbstractEmail):
        pass

    __all__.append('Email')


if not is_model_registered('customer', 'CommunicationEventType'):
    class CommunicationEventType(
            abstract_models.AbstractCommunicationEventType):
        pass

    __all__.append('CommunicationEventType')


if not is_model_registered('customer', 'Notification'):
    class Notification(abstract_models.AbstractNotification):
        pass

    __all__.append('Notification')


if not is_model_registered('customer', 'ProductAlert'):
    class ProductAlert(abstract_models.AbstractProductAlert):
        pass
Пример #13
0
from izi.apps.address.abstract_models import (AbstractCountry,
                                              AbstractUserAddress)
from izi.core.loading import is_model_registered

__all__ = []

if not is_model_registered('address', 'UserAddress'):

    class UserAddress(AbstractUserAddress):
        pass

    __all__.append('UserAddress')

if not is_model_registered('address', 'Country'):

    class Country(AbstractCountry):
        pass

    __all__.append('Country')
Пример #14
0
from izi.apps.offer.abstract_models import (AbstractBenefit, AbstractCondition,
                                            AbstractConditionalOffer,
                                            AbstractRange,
                                            AbstractRangeProduct,
                                            AbstractRangeProductFileUpload)
from izi.apps.offer.results import (SHIPPING_DISCOUNT, ZERO_DISCOUNT,
                                    BasketDiscount, PostOrderAction,
                                    ShippingDiscount)
from izi.core.loading import is_model_registered

__all__ = [
    'BasketDiscount', 'ShippingDiscount', 'PostOrderAction',
    'SHIPPING_DISCOUNT', 'ZERO_DISCOUNT'
]

if not is_model_registered('offer', 'ConditionalOffer'):

    class ConditionalOffer(AbstractConditionalOffer):
        pass

    __all__.append('ConditionalOffer')

if not is_model_registered('offer', 'Benefit'):

    class Benefit(AbstractBenefit):
        pass

    __all__.append('Benefit')

if not is_model_registered('offer', 'Condition'):