1) Userless orders will be merged on user's registration by their phone number and/or email. Added Viewset action "merge_recently_viewed" so recently viewed products may be stored on server's side. 2) Added comprehensive products' filtering by category(support for including subcategories) Fixes: I18N
59 lines
1.2 KiB
Python
59 lines
1.2 KiB
Python
from modeltranslation.decorators import register
|
|
from modeltranslation.translator import TranslationOptions
|
|
|
|
from core.models import (
|
|
Attribute,
|
|
AttributeGroup,
|
|
AttributeValue,
|
|
Brand,
|
|
Category,
|
|
CategoryTag,
|
|
Product,
|
|
ProductTag,
|
|
Promotion,
|
|
)
|
|
|
|
|
|
@register(AttributeGroup)
|
|
class AttributeGroupOptions(TranslationOptions):
|
|
fields = ("name",)
|
|
|
|
|
|
@register(Attribute)
|
|
class AttributeOptions(TranslationOptions):
|
|
fields = ("name",)
|
|
|
|
|
|
@register(AttributeValue)
|
|
class AttributeValueOptions(TranslationOptions):
|
|
fields = ("value",)
|
|
|
|
|
|
@register(Brand)
|
|
class BrandTranslationOptions(TranslationOptions):
|
|
fields = ("description",)
|
|
|
|
|
|
@register(Category)
|
|
class CategoryTranslationOptions(TranslationOptions):
|
|
fields = ("name", "description")
|
|
|
|
|
|
@register(Product)
|
|
class ProductTranslationOptions(TranslationOptions):
|
|
fields = ("name", "description")
|
|
|
|
|
|
@register(ProductTag)
|
|
class ProductTagOptions(TranslationOptions):
|
|
fields = ("name",)
|
|
|
|
|
|
@register(CategoryTag)
|
|
class CategoryTagOptions(TranslationOptions):
|
|
fields = ("name",)
|
|
|
|
|
|
@register(Promotion)
|
|
class PromotionOptions(TranslationOptions):
|
|
fields = ("name", "description")
|