Created
September 20, 2018 06:25
-
-
Save pelid/0599dba0ec7716d07bfb3b2d76fc90e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Merchandise(): | |
"""Бывший ProductInCatalog, переименовал во избежание дальнейшей путаницы""" | |
"""Редактируется менеджерами Bosch в отдельной таблице""" | |
product = models.ForeignKey(Product) | |
catalog = models.ForeignKey(Catalog) # slug каталога для привязки конфигурации каталога, зашитой в код | |
is_new = models.BooleanField(u'new!') | |
is_hit = models.BooleanField(u'hit!') | |
available = models.BooleanField(u'в продажу') | |
suggested_price = models.DecimalField(u'цена') # цена указана в валюте, использующейся в каталоге | |
unique_together = (product, catalog) | |
class MerchandiseInCategory(): | |
"""Редактируется менеджерами Bosch в виде admin inlines на странице редактирования СatalogCategory или Merchandise""" | |
merchandise = models.ForeignKey(Merchandise) | |
category = models.ForeignKey(СatalogCategory) | |
order_position = models.PositiveSmallIntegerField(unique=True) | |
unique_together = (merchandise, category) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment