We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Adapt catalog models to the new Product-Position hierarhy. stb2
Created the new hierarhy at https://github.com/fidals/refarm-site/issues/261

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `shopelectro/models.py`
Content:
```
1 import enum
2 import random
3 import string
4 import typing
5 from uuid import uuid4
6 
7 from django.conf import settings
8 from django.db import models
9 from django.urls import reverse
10 from django.utils.translation import ugettext_lazy as _
11 
12 from catalog import models as catalog_models
13 from ecommerce import models as ecommerce_models
14 from pages import models as pages_models
15 
16 
17 def randomize_slug(slug: str) -> str:
18     slug_hash = ''.join(
19         random.choices(string.ascii_lowercase, k=settings.SLUG_HASH_SIZE)
20     )
21     return f'{slug}_{slug_hash}'
22 
23 
24 class SECategoryQuerySet(catalog_models.CategoryQuerySet):
25     def get_categories_tree_with_pictures(self) -> 'SECategoryQuerySet':
26         categories_with_pictures = (
27             self
28             .filter(products__page__images__isnull=False)
29             .distinct()
30         )
31 
32         return categories_with_pictures.get_ancestors(include_self=True)
33 
34 
35 class SECategoryManager(
36     catalog_models.CategoryManager.from_queryset(SECategoryQuerySet)
37 ):
38     pass
39 
40 
41 class Category(catalog_models.AbstractCategory, pages_models.SyncPageMixin):
42 
43     objects = SECategoryManager()
44     uuid = models.UUIDField(default=uuid4, editable=False)
45 
46     @classmethod
47     def get_default_parent(cls):
48         return pages_models.CustomPage.objects.filter(slug='catalog').first()
49 
50     @property
51     def image(self):
52         products = self.products.all()
53         return products[0].image if products else None
54 
55     def get_absolute_url(self):
56         return reverse('category', args=(self.page.slug,))
57 
58 
59 class Product(catalog_models.AbstractProduct, pages_models.SyncPageMixin):
60 
61     # That's why we are needed to explicitly add objects manager here
62     # because of Django special managers behaviour.
63     # Se se#480 for details.
64     objects = catalog_models.ProductManager()
65 
66     category = models.ForeignKey(
67         Category,
68         on_delete=models.CASCADE,
69         null=True,
70         related_name='products',
71         verbose_name=_('category'),
72     )
73 
74     tags = models.ManyToManyField(
75         'Tag',
76         related_name='products',
77         blank=True,
78         verbose_name=_('tags'),
79     )
80 
81     vendor_code = models.SmallIntegerField(verbose_name=_('vendor_code'))
82     uuid = models.UUIDField(default=uuid4, editable=False)
83     purchase_price = models.FloatField(
84         default=0, verbose_name=_('purchase_price'))
85     wholesale_small = models.FloatField(
86         default=0, verbose_name=_('wholesale_small'))
87     wholesale_medium = models.FloatField(
88         default=0, verbose_name=_('wholesale_medium'))
89     wholesale_large = models.FloatField(
90         default=0, verbose_name=_('wholesale_large'))
91 
92     def get_absolute_url(self):
93         return reverse('product', args=(self.vendor_code,))
94 
95     @property
96     def average_rate(self):
97         """Return rounded to first decimal averaged rating."""
98         rating = self.product_feedbacks.aggregate(
99             avg=models.Avg('rating')).get('avg', 0)
100         return round(rating, 1)
101 
102     @property
103     def feedback_count(self):
104         return self.product_feedbacks.count()
105 
106     @property
107     def feedback(self):
108         return self.product_feedbacks.all().order_by('-date')
109 
110     def get_params(self):
111         return Tag.objects.filter_by_products([self]).group_tags()
112 
113     def get_brand_name(self) -> str:
114         brand: typing.Optional['Tag'] = Tag.objects.get_brands([self]).get(self)
115         return brand.name if brand else ''
116 
117 
118 class ProductFeedback(models.Model):
119     product = models.ForeignKey(
120         Product, on_delete=models.CASCADE, null=True,
121         related_name='product_feedbacks'
122     )
123 
124     date = models.DateTimeField(
125         auto_now=True, db_index=True, verbose_name=_('date'))
126     name = models.CharField(
127         max_length=255, db_index=True, verbose_name=_('name'))
128     rating = models.PositiveSmallIntegerField(
129         default=1, db_index=True, verbose_name=_('rating'))
130     dignities = models.TextField(
131         default='', blank=True, verbose_name=_('dignities'))
132     limitations = models.TextField(
133         default='', blank=True, verbose_name=_('limitations'))
134     general = models.TextField(
135         default='', blank=True, verbose_name=_('limitations'))
136 
137 
138 class ItemsEnum(enum.EnumMeta):
139     """
140     Provide dict-like `items` method.
141 
142     https://docs.python.org/3/library/enum.html#enum-classes
143     """
144 
145     def items(self):
146         return [(i.name, i.value) for i in self]
147 
148     def __repr__(self):
149         fields = ', '.join(i.name for i in self)
150         return f"<enum '{self.__name__}: {fields}'>"
151 
152 
153 class PaymentOptions(enum.Enum, metaclass=ItemsEnum):
154     cash = 'Наличные'
155     cashless = 'Безналичные и денежные переводы'
156     AC = 'Банковская карта'
157     PC = 'Яндекс.Деньги'
158     GP = 'Связной (терминал)'
159     AB = 'Альфа-Клик'
160 
161     @staticmethod
162     def default():
163         return PaymentOptions.cash
164 
165 
166 class Order(ecommerce_models.Order):
167     address = models.TextField(blank=True, default='')
168     payment_type = models.CharField(
169         max_length=255,
170         choices=PaymentOptions.items(),
171         default=PaymentOptions.default().name,
172     )
173     comment = models.TextField(blank=True, default='')
174     # total price - total purchase price
175     revenue = models.FloatField(default=0, null=True, verbose_name=_('revenue'))
176 
177     @property
178     def payment_type_label(self):
179         """Return label for an order's payment option."""
180         return PaymentOptions[self.payment_type].value
181 
182     def set_positions(self, cart):
183         """
184         Save cart's state into Order instance.
185 
186         @todo #589:60m Create Cart model.
187          See details here: https://github.com/fidals/shopelectro/pull/590#discussion_r222544672
188         """
189         self.revenue = cart.total_revenue()
190         self.save()
191         for id_, position in cart:
192             self.positions.create(
193                 order=self,
194                 product_id=id_,
195                 vendor_code=position['vendor_code'],
196                 name=position['name'],
197                 price=position['price'],
198                 quantity=position['quantity'],
199             )
200         return self
201 
202 
203 class CategoryPage(pages_models.ModelPage):
204     """Create proxy model for Admin."""
205 
206     class Meta(pages_models.ModelPage.Meta):  # Ignore PycodestyleBear (E303)
207         proxy = True
208 
209     # noinspection PyTypeChecker
210     objects = pages_models.ModelPage.create_model_page_managers(Category)
211 
212 
213 class ProductPage(pages_models.ModelPage):
214     """Create proxy model for Admin."""
215 
216     class Meta(pages_models.ModelPage.Meta):  # Ignore PycodestyleBear (E303)
217         proxy = True
218 
219     # noinspection PyTypeChecker
220     objects = (
221         pages_models.ModelPage
222         .create_model_page_managers(Product)
223     )
224 
225 
226 class TagGroup(catalog_models.TagGroup):
227     pass
228 
229 
230 class TagQuerySet(catalog_models.TagQuerySet):
231     pass
232 
233 
234 class Tag(catalog_models.Tag):
235     group = models.ForeignKey(
236         TagGroup, on_delete=models.CASCADE, null=True, related_name='tags',
237     )
238
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/shopelectro/models.py b/shopelectro/models.py
--- a/shopelectro/models.py
+++ b/shopelectro/models.py
@@ -56,7 +56,11 @@
         return reverse('category', args=(self.page.slug,))
 
 
-class Product(catalog_models.AbstractProduct, pages_models.SyncPageMixin):
+class Product(
+    catalog_models.AbstractProduct,
+    catalog_models.AbstractPosition,
+    pages_models.SyncPageMixin
+):
 
     # That's why we are needed to explicitly add objects manager here
     # because of Django special managers behaviour.

{"golden_diff": "diff --git a/shopelectro/models.py b/shopelectro/models.py\n--- a/shopelectro/models.py\n+++ b/shopelectro/models.py\n@@ -56,7 +56,11 @@\n         return reverse('category', args=(self.page.slug,))\n \n \n-class Product(catalog_models.AbstractProduct, pages_models.SyncPageMixin):\n+class Product(\n+    catalog_models.AbstractProduct,\n+    catalog_models.AbstractPosition,\n+    pages_models.SyncPageMixin\n+):\n \n     # That's why we are needed to explicitly add objects manager here\n     # because of Django special managers behaviour.\n", "issue": "Adapt catalog models to the new Product-Position hierarhy. stb2\nCreated the new hierarhy at https://github.com/fidals/refarm-site/issues/261\n", "before_files": [{"content": "import enum\nimport random\nimport string\nimport typing\nfrom uuid import uuid4\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.urls import reverse\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom catalog import models as catalog_models\nfrom ecommerce import models as ecommerce_models\nfrom pages import models as pages_models\n\n\ndef randomize_slug(slug: str) -> str:\n    slug_hash = ''.join(\n        random.choices(string.ascii_lowercase, k=settings.SLUG_HASH_SIZE)\n    )\n    return f'{slug}_{slug_hash}'\n\n\nclass SECategoryQuerySet(catalog_models.CategoryQuerySet):\n    def get_categories_tree_with_pictures(self) -> 'SECategoryQuerySet':\n        categories_with_pictures = (\n            self\n            .filter(products__page__images__isnull=False)\n            .distinct()\n        )\n\n        return categories_with_pictures.get_ancestors(include_self=True)\n\n\nclass SECategoryManager(\n    catalog_models.CategoryManager.from_queryset(SECategoryQuerySet)\n):\n    pass\n\n\nclass Category(catalog_models.AbstractCategory, pages_models.SyncPageMixin):\n\n    objects = SECategoryManager()\n    uuid = models.UUIDField(default=uuid4, editable=False)\n\n    @classmethod\n    def get_default_parent(cls):\n        return pages_models.CustomPage.objects.filter(slug='catalog').first()\n\n    @property\n    def image(self):\n        products = self.products.all()\n        return products[0].image if products else None\n\n    def get_absolute_url(self):\n        return reverse('category', args=(self.page.slug,))\n\n\nclass Product(catalog_models.AbstractProduct, pages_models.SyncPageMixin):\n\n    # That's why we are needed to explicitly add objects manager here\n    # because of Django special managers behaviour.\n    # Se se#480 for details.\n    objects = catalog_models.ProductManager()\n\n    category = models.ForeignKey(\n        Category,\n        on_delete=models.CASCADE,\n        null=True,\n        related_name='products',\n        verbose_name=_('category'),\n    )\n\n    tags = models.ManyToManyField(\n        'Tag',\n        related_name='products',\n        blank=True,\n        verbose_name=_('tags'),\n    )\n\n    vendor_code = models.SmallIntegerField(verbose_name=_('vendor_code'))\n    uuid = models.UUIDField(default=uuid4, editable=False)\n    purchase_price = models.FloatField(\n        default=0, verbose_name=_('purchase_price'))\n    wholesale_small = models.FloatField(\n        default=0, verbose_name=_('wholesale_small'))\n    wholesale_medium = models.FloatField(\n        default=0, verbose_name=_('wholesale_medium'))\n    wholesale_large = models.FloatField(\n        default=0, verbose_name=_('wholesale_large'))\n\n    def get_absolute_url(self):\n        return reverse('product', args=(self.vendor_code,))\n\n    @property\n    def average_rate(self):\n        \"\"\"Return rounded to first decimal averaged rating.\"\"\"\n        rating = self.product_feedbacks.aggregate(\n            avg=models.Avg('rating')).get('avg', 0)\n        return round(rating, 1)\n\n    @property\n    def feedback_count(self):\n        return self.product_feedbacks.count()\n\n    @property\n    def feedback(self):\n        return self.product_feedbacks.all().order_by('-date')\n\n    def get_params(self):\n        return Tag.objects.filter_by_products([self]).group_tags()\n\n    def get_brand_name(self) -> str:\n        brand: typing.Optional['Tag'] = Tag.objects.get_brands([self]).get(self)\n        return brand.name if brand else ''\n\n\nclass ProductFeedback(models.Model):\n    product = models.ForeignKey(\n        Product, on_delete=models.CASCADE, null=True,\n        related_name='product_feedbacks'\n    )\n\n    date = models.DateTimeField(\n        auto_now=True, db_index=True, verbose_name=_('date'))\n    name = models.CharField(\n        max_length=255, db_index=True, verbose_name=_('name'))\n    rating = models.PositiveSmallIntegerField(\n        default=1, db_index=True, verbose_name=_('rating'))\n    dignities = models.TextField(\n        default='', blank=True, verbose_name=_('dignities'))\n    limitations = models.TextField(\n        default='', blank=True, verbose_name=_('limitations'))\n    general = models.TextField(\n        default='', blank=True, verbose_name=_('limitations'))\n\n\nclass ItemsEnum(enum.EnumMeta):\n    \"\"\"\n    Provide dict-like `items` method.\n\n    https://docs.python.org/3/library/enum.html#enum-classes\n    \"\"\"\n\n    def items(self):\n        return [(i.name, i.value) for i in self]\n\n    def __repr__(self):\n        fields = ', '.join(i.name for i in self)\n        return f\"<enum '{self.__name__}: {fields}'>\"\n\n\nclass PaymentOptions(enum.Enum, metaclass=ItemsEnum):\n    cash = '\u041d\u0430\u043b\u0438\u0447\u043d\u044b\u0435'\n    cashless = '\u0411\u0435\u0437\u043d\u0430\u043b\u0438\u0447\u043d\u044b\u0435 \u0438 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b'\n    AC = '\u0411\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0430'\n    PC = '\u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0435\u043d\u044c\u0433\u0438'\n    GP = '\u0421\u0432\u044f\u0437\u043d\u043e\u0439 (\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b)'\n    AB = '\u0410\u043b\u044c\u0444\u0430-\u041a\u043b\u0438\u043a'\n\n    @staticmethod\n    def default():\n        return PaymentOptions.cash\n\n\nclass Order(ecommerce_models.Order):\n    address = models.TextField(blank=True, default='')\n    payment_type = models.CharField(\n        max_length=255,\n        choices=PaymentOptions.items(),\n        default=PaymentOptions.default().name,\n    )\n    comment = models.TextField(blank=True, default='')\n    # total price - total purchase price\n    revenue = models.FloatField(default=0, null=True, verbose_name=_('revenue'))\n\n    @property\n    def payment_type_label(self):\n        \"\"\"Return label for an order's payment option.\"\"\"\n        return PaymentOptions[self.payment_type].value\n\n    def set_positions(self, cart):\n        \"\"\"\n        Save cart's state into Order instance.\n\n        @todo #589:60m Create Cart model.\n         See details here: https://github.com/fidals/shopelectro/pull/590#discussion_r222544672\n        \"\"\"\n        self.revenue = cart.total_revenue()\n        self.save()\n        for id_, position in cart:\n            self.positions.create(\n                order=self,\n                product_id=id_,\n                vendor_code=position['vendor_code'],\n                name=position['name'],\n                price=position['price'],\n                quantity=position['quantity'],\n            )\n        return self\n\n\nclass CategoryPage(pages_models.ModelPage):\n    \"\"\"Create proxy model for Admin.\"\"\"\n\n    class Meta(pages_models.ModelPage.Meta):  # Ignore PycodestyleBear (E303)\n        proxy = True\n\n    # noinspection PyTypeChecker\n    objects = pages_models.ModelPage.create_model_page_managers(Category)\n\n\nclass ProductPage(pages_models.ModelPage):\n    \"\"\"Create proxy model for Admin.\"\"\"\n\n    class Meta(pages_models.ModelPage.Meta):  # Ignore PycodestyleBear (E303)\n        proxy = True\n\n    # noinspection PyTypeChecker\n    objects = (\n        pages_models.ModelPage\n        .create_model_page_managers(Product)\n    )\n\n\nclass TagGroup(catalog_models.TagGroup):\n    pass\n\n\nclass TagQuerySet(catalog_models.TagQuerySet):\n    pass\n\n\nclass Tag(catalog_models.Tag):\n    group = models.ForeignKey(\n        TagGroup, on_delete=models.CASCADE, null=True, related_name='tags',\n    )\n", "path": "shopelectro/models.py"}], "after_files": [{"content": "import enum\nimport random\nimport string\nimport typing\nfrom uuid import uuid4\n\nfrom django.conf import settings\nfrom django.db import models\nfrom django.urls import reverse\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom catalog import models as catalog_models\nfrom ecommerce import models as ecommerce_models\nfrom pages import models as pages_models\n\n\ndef randomize_slug(slug: str) -> str:\n    slug_hash = ''.join(\n        random.choices(string.ascii_lowercase, k=settings.SLUG_HASH_SIZE)\n    )\n    return f'{slug}_{slug_hash}'\n\n\nclass SECategoryQuerySet(catalog_models.CategoryQuerySet):\n    def get_categories_tree_with_pictures(self) -> 'SECategoryQuerySet':\n        categories_with_pictures = (\n            self\n            .filter(products__page__images__isnull=False)\n            .distinct()\n        )\n\n        return categories_with_pictures.get_ancestors(include_self=True)\n\n\nclass SECategoryManager(\n    catalog_models.CategoryManager.from_queryset(SECategoryQuerySet)\n):\n    pass\n\n\nclass Category(catalog_models.AbstractCategory, pages_models.SyncPageMixin):\n\n    objects = SECategoryManager()\n    uuid = models.UUIDField(default=uuid4, editable=False)\n\n    @classmethod\n    def get_default_parent(cls):\n        return pages_models.CustomPage.objects.filter(slug='catalog').first()\n\n    @property\n    def image(self):\n        products = self.products.all()\n        return products[0].image if products else None\n\n    def get_absolute_url(self):\n        return reverse('category', args=(self.page.slug,))\n\n\nclass Product(\n    catalog_models.AbstractProduct,\n    catalog_models.AbstractPosition,\n    pages_models.SyncPageMixin\n):\n\n    # That's why we are needed to explicitly add objects manager here\n    # because of Django special managers behaviour.\n    # Se se#480 for details.\n    objects = catalog_models.ProductManager()\n\n    category = models.ForeignKey(\n        Category,\n        on_delete=models.CASCADE,\n        null=True,\n        related_name='products',\n        verbose_name=_('category'),\n    )\n\n    tags = models.ManyToManyField(\n        'Tag',\n        related_name='products',\n        blank=True,\n        verbose_name=_('tags'),\n    )\n\n    vendor_code = models.SmallIntegerField(verbose_name=_('vendor_code'))\n    uuid = models.UUIDField(default=uuid4, editable=False)\n    purchase_price = models.FloatField(\n        default=0, verbose_name=_('purchase_price'))\n    wholesale_small = models.FloatField(\n        default=0, verbose_name=_('wholesale_small'))\n    wholesale_medium = models.FloatField(\n        default=0, verbose_name=_('wholesale_medium'))\n    wholesale_large = models.FloatField(\n        default=0, verbose_name=_('wholesale_large'))\n\n    def get_absolute_url(self):\n        return reverse('product', args=(self.vendor_code,))\n\n    @property\n    def average_rate(self):\n        \"\"\"Return rounded to first decimal averaged rating.\"\"\"\n        rating = self.product_feedbacks.aggregate(\n            avg=models.Avg('rating')).get('avg', 0)\n        return round(rating, 1)\n\n    @property\n    def feedback_count(self):\n        return self.product_feedbacks.count()\n\n    @property\n    def feedback(self):\n        return self.product_feedbacks.all().order_by('-date')\n\n    def get_params(self):\n        return Tag.objects.filter_by_products([self]).group_tags()\n\n    def get_brand_name(self) -> str:\n        brand: typing.Optional['Tag'] = Tag.objects.get_brands([self]).get(self)\n        return brand.name if brand else ''\n\n\nclass ProductFeedback(models.Model):\n    product = models.ForeignKey(\n        Product, on_delete=models.CASCADE, null=True,\n        related_name='product_feedbacks'\n    )\n\n    date = models.DateTimeField(\n        auto_now=True, db_index=True, verbose_name=_('date'))\n    name = models.CharField(\n        max_length=255, db_index=True, verbose_name=_('name'))\n    rating = models.PositiveSmallIntegerField(\n        default=1, db_index=True, verbose_name=_('rating'))\n    dignities = models.TextField(\n        default='', blank=True, verbose_name=_('dignities'))\n    limitations = models.TextField(\n        default='', blank=True, verbose_name=_('limitations'))\n    general = models.TextField(\n        default='', blank=True, verbose_name=_('limitations'))\n\n\nclass ItemsEnum(enum.EnumMeta):\n    \"\"\"\n    Provide dict-like `items` method.\n\n    https://docs.python.org/3/library/enum.html#enum-classes\n    \"\"\"\n\n    def items(self):\n        return [(i.name, i.value) for i in self]\n\n    def __repr__(self):\n        fields = ', '.join(i.name for i in self)\n        return f\"<enum '{self.__name__}: {fields}'>\"\n\n\nclass PaymentOptions(enum.Enum, metaclass=ItemsEnum):\n    cash = '\u041d\u0430\u043b\u0438\u0447\u043d\u044b\u0435'\n    cashless = '\u0411\u0435\u0437\u043d\u0430\u043b\u0438\u0447\u043d\u044b\u0435 \u0438 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b'\n    AC = '\u0411\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0430'\n    PC = '\u042f\u043d\u0434\u0435\u043a\u0441.\u0414\u0435\u043d\u044c\u0433\u0438'\n    GP = '\u0421\u0432\u044f\u0437\u043d\u043e\u0439 (\u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b)'\n    AB = '\u0410\u043b\u044c\u0444\u0430-\u041a\u043b\u0438\u043a'\n\n    @staticmethod\n    def default():\n        return PaymentOptions.cash\n\n\nclass Order(ecommerce_models.Order):\n    address = models.TextField(blank=True, default='')\n    payment_type = models.CharField(\n        max_length=255,\n        choices=PaymentOptions.items(),\n        default=PaymentOptions.default().name,\n    )\n    comment = models.TextField(blank=True, default='')\n    # total price - total purchase price\n    revenue = models.FloatField(default=0, null=True, verbose_name=_('revenue'))\n\n    @property\n    def payment_type_label(self):\n        \"\"\"Return label for an order's payment option.\"\"\"\n        return PaymentOptions[self.payment_type].value\n\n    def set_positions(self, cart):\n        \"\"\"\n        Save cart's state into Order instance.\n\n        @todo #589:60m Create Cart model.\n         See details here: https://github.com/fidals/shopelectro/pull/590#discussion_r222544672\n        \"\"\"\n        self.revenue = cart.total_revenue()\n        self.save()\n        for id_, position in cart:\n            self.positions.create(\n                order=self,\n                product_id=id_,\n                vendor_code=position['vendor_code'],\n                name=position['name'],\n                price=position['price'],\n                quantity=position['quantity'],\n            )\n        return self\n\n\nclass CategoryPage(pages_models.ModelPage):\n    \"\"\"Create proxy model for Admin.\"\"\"\n\n    class Meta(pages_models.ModelPage.Meta):  # Ignore PycodestyleBear (E303)\n        proxy = True\n\n    # noinspection PyTypeChecker\n    objects = pages_models.ModelPage.create_model_page_managers(Category)\n\n\nclass ProductPage(pages_models.ModelPage):\n    \"\"\"Create proxy model for Admin.\"\"\"\n\n    class Meta(pages_models.ModelPage.Meta):  # Ignore PycodestyleBear (E303)\n        proxy = True\n\n    # noinspection PyTypeChecker\n    objects = (\n        pages_models.ModelPage\n        .create_model_page_managers(Product)\n    )\n\n\nclass TagGroup(catalog_models.TagGroup):\n    pass\n\n\nclass TagQuerySet(catalog_models.TagQuerySet):\n    pass\n\n\nclass Tag(catalog_models.Tag):\n    group = models.ForeignKey(\n        TagGroup, on_delete=models.CASCADE, null=True, related_name='tags',\n    )\n", "path": "shopelectro/models.py"}]}