We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Верни список заказов в админку
Помнится у нас был список заказов в админке, но его несколько раз ломали и выпиливали. Возвращай.

--- 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/admin.py`
Content:
```
1 from django.contrib import admin
2 from django.contrib.admin.widgets import FilteredSelectMultiple
3 from django.contrib.redirects.models import Redirect
4 from django.db import models as django_models
5 from django.urls import reverse
6 from django.utils.html import format_html
7 from django.utils.translation import ugettext_lazy as _
8 
9 from django_select2.forms import ModelSelect2Widget
10 
11 from pages.models import CustomPage, FlatPage, PageTemplate
12 from generic_admin import inlines, models, sites
13 
14 from shopelectro import models as se_models
15 from shopelectro.views.admin import TableEditor
16 
17 
18 class SEAdminSite(sites.SiteWithTableEditor):
19 
20     site_header = 'Shopelectro administration'
21     table_editor_view = TableEditor
22 
23 
24 def prepare_has_filter_queryset(value, db_table, queryset):
25     if not value:
26         return
27 
28     query = '{}__tags__isnull'.format(db_table)
29 
30     # Use brackets, because `Explicit is better than implicit`.
31     return queryset.filter(**{query: value != 'yes'})
32 
33 
34 class HasTagsFilter(admin.SimpleListFilter):
35 
36     product_model = se_models.Product
37     title = _('has tags')
38     parameter_name = 'has_tags'
39 
40     def lookups(self, request, model_admin):
41         return (
42             ('yes', _('Has tags')),
43             ('no', _('Has no tags')),
44         )
45 
46     def queryset(self, request, queryset):
47         return prepare_has_filter_queryset(
48             self.value(),
49             self.product_model._meta.db_table,
50             queryset
51         )
52 
53 
54 class HasCategoryFilter(admin.SimpleListFilter):
55 
56     product_model = se_models.Product
57     title = _('has category')
58     parameter_name = 'has_category'
59 
60     def lookups(self, request, model_admin):
61         return (
62             ('yes', _('Has category')),
63             ('no', _('Has no category')),
64         )
65 
66     def queryset(self, request, queryset):
67         return prepare_has_filter_queryset(
68             self.value(),
69             self.product_model._meta.db_table,
70             queryset
71         )
72 
73 
74 class TagInline(admin.StackedInline):
75 
76     model = se_models.Tag
77     extra = 0
78 
79 
80 class CategoryInline(inlines.CategoryInline):
81 
82     model = se_models.Category
83 
84     fieldsets = ((None, {
85         'classes': ('primary-chars', ),
86         'fields': (
87             ('name', 'id'),
88             ('parent', 'correct_parent_id'),
89         )
90     }),)
91 
92 
93 class ProductInline(inlines.ProductInline):
94 
95     model = se_models.Product
96 
97     formfield_overrides = {
98         django_models.ManyToManyField: {
99             'widget': FilteredSelectMultiple(verbose_name='Tags', is_stacked=False)
100         },
101     }
102 
103     fieldsets = ((None, {
104         'classes': ('primary-chars', ),
105         'fields': (
106             ('name', 'id'),
107             ('category', 'correct_category_id'),
108             ('price', 'in_stock'),
109             'is_popular',
110             ('purchase_price', 'wholesale_small'),
111             ('wholesale_medium', 'wholesale_large'),
112             'tags',
113         )
114     }),)
115 
116     def formfield_for_dbfield(self, db_field, **kwargs):
117         if db_field.name == 'category':
118             kwargs['widget'] = ModelSelect2Widget(
119                 model=se_models.Category,
120                 search_fields=[
121                     'name__icontains',
122                     'pk__startswith',
123                 ],
124             )
125         return super(ProductInline, self).formfield_for_dbfield(
126             db_field,
127             **kwargs,
128         )
129 
130 
131 class CategoryPageAdmin(models.CategoryPageAdmin):
132 
133     add = False
134     delete = False
135     inlines = [CategoryInline, inlines.ImageInline]
136 
137     def get_queryset(self, request):
138         return (
139             super(CategoryPageAdmin, self)
140             .get_queryset(request)
141             .select_related('shopelectro_category')
142         )
143 
144 
145 class ProductPageAdmin(models.ProductPageAdmin):
146 
147     add = False
148     delete = False
149     category_page_model = se_models.CategoryPage
150     list_filter = [*models.ProductPageAdmin.list_filter, HasTagsFilter, HasCategoryFilter]
151     inlines = [ProductInline, inlines.ImageInline]
152     search_fields = [
153         'shopelectro_product__vendor_code', 'name', 'slug',
154     ]
155 
156     def model_id(self, obj):
157         return obj.model.vendor_code
158 
159     model_id.short_description = _('Vendor code')
160     model_id.admin_order_field = 'shopelectro_product__vendor_code'
161 
162     def get_queryset(self, request):
163         return (
164             super(ProductPageAdmin, self)
165             .get_queryset(request)
166             .select_related('shopelectro_product')
167         )
168 
169 
170 class ProductFeedbackPageAdmin(admin.ModelAdmin):
171 
172     add = False
173     delete = False
174     list_filter = ['rating']
175     list_display = ['rating', 'name', 'dignities', 'limitations', 'general', 'links']
176 
177     def links(self, obj):
178         return format_html(
179             '''
180             <a href="{url}" class="field-link" title="Посмотреть на сайте" target="_blank">
181               <i class="fa fa-link" aria-hidden="true"></i>
182             </a>
183             '''.format(url=obj.product.url))
184 
185     links.short_description = _('Link')
186 
187     def get_queryset(self, request):
188         return (
189             super(ProductFeedbackPageAdmin, self)
190             .get_queryset(request)
191             .select_related('product')
192         )
193 
194 
195 class TagGroupAdmin(admin.ModelAdmin):
196 
197     list_display = ['id', 'name', 'position', 'count_tags']
198     list_display_links = ['name']
199 
200     inlines = [TagInline]
201 
202     def get_queryset(self, request):
203         return super(TagGroupAdmin, self).get_queryset(request).prefetch_related('tags')
204 
205     def count_tags(self, obj):
206         return obj.tags.count()
207 
208 
209 class TagAdmin(admin.ModelAdmin):
210 
211     search_fields = ['id', 'name']
212     list_display = ['id', 'name', 'position', 'custom_group']
213     list_display_links = ['name']
214 
215     def get_queryset(self, request):
216         return super(TagAdmin, self).get_queryset(request).prefetch_related('group')
217 
218     def custom_group(self, obj):
219         group = obj.group
220 
221         return format_html(
222             '<a href="{url}">{group}</a>',
223             group=group,
224             url=reverse('admin:shopelectro_taggroup_change', args=(group.id, ))
225         )
226 
227     custom_group.admin_order_field = 'group'
228     custom_group.short_description = _('Group')
229 
230 
231 se_admin = SEAdminSite(name='se_admin')
232 se_admin.register(CustomPage, models.CustomPageAdmin)
233 se_admin.register(FlatPage, models.FlatPageAdmin)
234 se_admin.register(PageTemplate, models.CustomPageTemplateAdmin)
235 
236 se_admin.register(se_models.CategoryPage, CategoryPageAdmin)
237 se_admin.register(se_models.ProductPage, ProductPageAdmin)
238 se_admin.register(se_models.ProductFeedback, ProductFeedbackPageAdmin)
239 se_admin.register(se_models.TagGroup, TagGroupAdmin)
240 se_admin.register(se_models.Tag, TagAdmin)
241 
242 se_admin.register(Redirect)
243
```
--- 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/admin.py b/shopelectro/admin.py
--- a/shopelectro/admin.py
+++ b/shopelectro/admin.py
@@ -8,8 +8,9 @@
 
 from django_select2.forms import ModelSelect2Widget
 
+from ecommerce.models import Position
 from pages.models import CustomPage, FlatPage, PageTemplate
-from generic_admin import inlines, models, sites
+from generic_admin import inlines, mixins, models, sites
 
 from shopelectro import models as se_models
 from shopelectro.views.admin import TableEditor
@@ -128,6 +129,11 @@
         )
 
 
+class PositionInline(admin.StackedInline):
+
+    model = Position
+
+
 class CategoryPageAdmin(models.CategoryPageAdmin):
 
     add = False
@@ -228,12 +234,21 @@
     custom_group.short_description = _('Group')
 
 
+class OrderAdmin(mixins.PermissionsControl):
+
+    add = False
+    inlines = [PositionInline]
+    list_display = ['name', 'email', 'phone', 'address', 'city', 'payment_type', 'paid']
+    search_fields = ['name', 'email', 'phone']
+    list_display_links = ['name']
+
 se_admin = SEAdminSite(name='se_admin')
 se_admin.register(CustomPage, models.CustomPageAdmin)
 se_admin.register(FlatPage, models.FlatPageAdmin)
 se_admin.register(PageTemplate, models.CustomPageTemplateAdmin)
 
 se_admin.register(se_models.CategoryPage, CategoryPageAdmin)
+se_admin.register(se_models.Order, OrderAdmin)
 se_admin.register(se_models.ProductPage, ProductPageAdmin)
 se_admin.register(se_models.ProductFeedback, ProductFeedbackPageAdmin)
 se_admin.register(se_models.TagGroup, TagGroupAdmin)

{"golden_diff": "diff --git a/shopelectro/admin.py b/shopelectro/admin.py\n--- a/shopelectro/admin.py\n+++ b/shopelectro/admin.py\n@@ -8,8 +8,9 @@\n \n from django_select2.forms import ModelSelect2Widget\n \n+from ecommerce.models import Position\n from pages.models import CustomPage, FlatPage, PageTemplate\n-from generic_admin import inlines, models, sites\n+from generic_admin import inlines, mixins, models, sites\n \n from shopelectro import models as se_models\n from shopelectro.views.admin import TableEditor\n@@ -128,6 +129,11 @@\n         )\n \n \n+class PositionInline(admin.StackedInline):\n+\n+    model = Position\n+\n+\n class CategoryPageAdmin(models.CategoryPageAdmin):\n \n     add = False\n@@ -228,12 +234,21 @@\n     custom_group.short_description = _('Group')\n \n \n+class OrderAdmin(mixins.PermissionsControl):\n+\n+    add = False\n+    inlines = [PositionInline]\n+    list_display = ['name', 'email', 'phone', 'address', 'city', 'payment_type', 'paid']\n+    search_fields = ['name', 'email', 'phone']\n+    list_display_links = ['name']\n+\n se_admin = SEAdminSite(name='se_admin')\n se_admin.register(CustomPage, models.CustomPageAdmin)\n se_admin.register(FlatPage, models.FlatPageAdmin)\n se_admin.register(PageTemplate, models.CustomPageTemplateAdmin)\n \n se_admin.register(se_models.CategoryPage, CategoryPageAdmin)\n+se_admin.register(se_models.Order, OrderAdmin)\n se_admin.register(se_models.ProductPage, ProductPageAdmin)\n se_admin.register(se_models.ProductFeedback, ProductFeedbackPageAdmin)\n se_admin.register(se_models.TagGroup, TagGroupAdmin)\n", "issue": "\u0412\u0435\u0440\u043d\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0443\n\u041f\u043e\u043c\u043d\u0438\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043a\u0430\u0437\u043e\u0432 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435, \u043d\u043e \u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043b\u043e\u043c\u0430\u043b\u0438 \u0438 \u0432\u044b\u043f\u0438\u043b\u0438\u0432\u0430\u043b\u0438. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439.\n", "before_files": [{"content": "from django.contrib import admin\nfrom django.contrib.admin.widgets import FilteredSelectMultiple\nfrom django.contrib.redirects.models import Redirect\nfrom django.db import models as django_models\nfrom django.urls import reverse\nfrom django.utils.html import format_html\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom django_select2.forms import ModelSelect2Widget\n\nfrom pages.models import CustomPage, FlatPage, PageTemplate\nfrom generic_admin import inlines, models, sites\n\nfrom shopelectro import models as se_models\nfrom shopelectro.views.admin import TableEditor\n\n\nclass SEAdminSite(sites.SiteWithTableEditor):\n\n    site_header = 'Shopelectro administration'\n    table_editor_view = TableEditor\n\n\ndef prepare_has_filter_queryset(value, db_table, queryset):\n    if not value:\n        return\n\n    query = '{}__tags__isnull'.format(db_table)\n\n    # Use brackets, because `Explicit is better than implicit`.\n    return queryset.filter(**{query: value != 'yes'})\n\n\nclass HasTagsFilter(admin.SimpleListFilter):\n\n    product_model = se_models.Product\n    title = _('has tags')\n    parameter_name = 'has_tags'\n\n    def lookups(self, request, model_admin):\n        return (\n            ('yes', _('Has tags')),\n            ('no', _('Has no tags')),\n        )\n\n    def queryset(self, request, queryset):\n        return prepare_has_filter_queryset(\n            self.value(),\n            self.product_model._meta.db_table,\n            queryset\n        )\n\n\nclass HasCategoryFilter(admin.SimpleListFilter):\n\n    product_model = se_models.Product\n    title = _('has category')\n    parameter_name = 'has_category'\n\n    def lookups(self, request, model_admin):\n        return (\n            ('yes', _('Has category')),\n            ('no', _('Has no category')),\n        )\n\n    def queryset(self, request, queryset):\n        return prepare_has_filter_queryset(\n            self.value(),\n            self.product_model._meta.db_table,\n            queryset\n        )\n\n\nclass TagInline(admin.StackedInline):\n\n    model = se_models.Tag\n    extra = 0\n\n\nclass CategoryInline(inlines.CategoryInline):\n\n    model = se_models.Category\n\n    fieldsets = ((None, {\n        'classes': ('primary-chars', ),\n        'fields': (\n            ('name', 'id'),\n            ('parent', 'correct_parent_id'),\n        )\n    }),)\n\n\nclass ProductInline(inlines.ProductInline):\n\n    model = se_models.Product\n\n    formfield_overrides = {\n        django_models.ManyToManyField: {\n            'widget': FilteredSelectMultiple(verbose_name='Tags', is_stacked=False)\n        },\n    }\n\n    fieldsets = ((None, {\n        'classes': ('primary-chars', ),\n        'fields': (\n            ('name', 'id'),\n            ('category', 'correct_category_id'),\n            ('price', 'in_stock'),\n            'is_popular',\n            ('purchase_price', 'wholesale_small'),\n            ('wholesale_medium', 'wholesale_large'),\n            'tags',\n        )\n    }),)\n\n    def formfield_for_dbfield(self, db_field, **kwargs):\n        if db_field.name == 'category':\n            kwargs['widget'] = ModelSelect2Widget(\n                model=se_models.Category,\n                search_fields=[\n                    'name__icontains',\n                    'pk__startswith',\n                ],\n            )\n        return super(ProductInline, self).formfield_for_dbfield(\n            db_field,\n            **kwargs,\n        )\n\n\nclass CategoryPageAdmin(models.CategoryPageAdmin):\n\n    add = False\n    delete = False\n    inlines = [CategoryInline, inlines.ImageInline]\n\n    def get_queryset(self, request):\n        return (\n            super(CategoryPageAdmin, self)\n            .get_queryset(request)\n            .select_related('shopelectro_category')\n        )\n\n\nclass ProductPageAdmin(models.ProductPageAdmin):\n\n    add = False\n    delete = False\n    category_page_model = se_models.CategoryPage\n    list_filter = [*models.ProductPageAdmin.list_filter, HasTagsFilter, HasCategoryFilter]\n    inlines = [ProductInline, inlines.ImageInline]\n    search_fields = [\n        'shopelectro_product__vendor_code', 'name', 'slug',\n    ]\n\n    def model_id(self, obj):\n        return obj.model.vendor_code\n\n    model_id.short_description = _('Vendor code')\n    model_id.admin_order_field = 'shopelectro_product__vendor_code'\n\n    def get_queryset(self, request):\n        return (\n            super(ProductPageAdmin, self)\n            .get_queryset(request)\n            .select_related('shopelectro_product')\n        )\n\n\nclass ProductFeedbackPageAdmin(admin.ModelAdmin):\n\n    add = False\n    delete = False\n    list_filter = ['rating']\n    list_display = ['rating', 'name', 'dignities', 'limitations', 'general', 'links']\n\n    def links(self, obj):\n        return format_html(\n            '''\n            <a href=\"{url}\" class=\"field-link\" title=\"\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435\" target=\"_blank\">\n              <i class=\"fa fa-link\" aria-hidden=\"true\"></i>\n            </a>\n            '''.format(url=obj.product.url))\n\n    links.short_description = _('Link')\n\n    def get_queryset(self, request):\n        return (\n            super(ProductFeedbackPageAdmin, self)\n            .get_queryset(request)\n            .select_related('product')\n        )\n\n\nclass TagGroupAdmin(admin.ModelAdmin):\n\n    list_display = ['id', 'name', 'position', 'count_tags']\n    list_display_links = ['name']\n\n    inlines = [TagInline]\n\n    def get_queryset(self, request):\n        return super(TagGroupAdmin, self).get_queryset(request).prefetch_related('tags')\n\n    def count_tags(self, obj):\n        return obj.tags.count()\n\n\nclass TagAdmin(admin.ModelAdmin):\n\n    search_fields = ['id', 'name']\n    list_display = ['id', 'name', 'position', 'custom_group']\n    list_display_links = ['name']\n\n    def get_queryset(self, request):\n        return super(TagAdmin, self).get_queryset(request).prefetch_related('group')\n\n    def custom_group(self, obj):\n        group = obj.group\n\n        return format_html(\n            '<a href=\"{url}\">{group}</a>',\n            group=group,\n            url=reverse('admin:shopelectro_taggroup_change', args=(group.id, ))\n        )\n\n    custom_group.admin_order_field = 'group'\n    custom_group.short_description = _('Group')\n\n\nse_admin = SEAdminSite(name='se_admin')\nse_admin.register(CustomPage, models.CustomPageAdmin)\nse_admin.register(FlatPage, models.FlatPageAdmin)\nse_admin.register(PageTemplate, models.CustomPageTemplateAdmin)\n\nse_admin.register(se_models.CategoryPage, CategoryPageAdmin)\nse_admin.register(se_models.ProductPage, ProductPageAdmin)\nse_admin.register(se_models.ProductFeedback, ProductFeedbackPageAdmin)\nse_admin.register(se_models.TagGroup, TagGroupAdmin)\nse_admin.register(se_models.Tag, TagAdmin)\n\nse_admin.register(Redirect)\n", "path": "shopelectro/admin.py"}], "after_files": [{"content": "from django.contrib import admin\nfrom django.contrib.admin.widgets import FilteredSelectMultiple\nfrom django.contrib.redirects.models import Redirect\nfrom django.db import models as django_models\nfrom django.urls import reverse\nfrom django.utils.html import format_html\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom django_select2.forms import ModelSelect2Widget\n\nfrom ecommerce.models import Position\nfrom pages.models import CustomPage, FlatPage, PageTemplate\nfrom generic_admin import inlines, mixins, models, sites\n\nfrom shopelectro import models as se_models\nfrom shopelectro.views.admin import TableEditor\n\n\nclass SEAdminSite(sites.SiteWithTableEditor):\n\n    site_header = 'Shopelectro administration'\n    table_editor_view = TableEditor\n\n\ndef prepare_has_filter_queryset(value, db_table, queryset):\n    if not value:\n        return\n\n    query = '{}__tags__isnull'.format(db_table)\n\n    # Use brackets, because `Explicit is better than implicit`.\n    return queryset.filter(**{query: value != 'yes'})\n\n\nclass HasTagsFilter(admin.SimpleListFilter):\n\n    product_model = se_models.Product\n    title = _('has tags')\n    parameter_name = 'has_tags'\n\n    def lookups(self, request, model_admin):\n        return (\n            ('yes', _('Has tags')),\n            ('no', _('Has no tags')),\n        )\n\n    def queryset(self, request, queryset):\n        return prepare_has_filter_queryset(\n            self.value(),\n            self.product_model._meta.db_table,\n            queryset\n        )\n\n\nclass HasCategoryFilter(admin.SimpleListFilter):\n\n    product_model = se_models.Product\n    title = _('has category')\n    parameter_name = 'has_category'\n\n    def lookups(self, request, model_admin):\n        return (\n            ('yes', _('Has category')),\n            ('no', _('Has no category')),\n        )\n\n    def queryset(self, request, queryset):\n        return prepare_has_filter_queryset(\n            self.value(),\n            self.product_model._meta.db_table,\n            queryset\n        )\n\n\nclass TagInline(admin.StackedInline):\n\n    model = se_models.Tag\n    extra = 0\n\n\nclass CategoryInline(inlines.CategoryInline):\n\n    model = se_models.Category\n\n    fieldsets = ((None, {\n        'classes': ('primary-chars', ),\n        'fields': (\n            ('name', 'id'),\n            ('parent', 'correct_parent_id'),\n        )\n    }),)\n\n\nclass ProductInline(inlines.ProductInline):\n\n    model = se_models.Product\n\n    formfield_overrides = {\n        django_models.ManyToManyField: {\n            'widget': FilteredSelectMultiple(verbose_name='Tags', is_stacked=False)\n        },\n    }\n\n    fieldsets = ((None, {\n        'classes': ('primary-chars', ),\n        'fields': (\n            ('name', 'id'),\n            ('category', 'correct_category_id'),\n            ('price', 'in_stock'),\n            'is_popular',\n            ('purchase_price', 'wholesale_small'),\n            ('wholesale_medium', 'wholesale_large'),\n            'tags',\n        )\n    }),)\n\n    def formfield_for_dbfield(self, db_field, **kwargs):\n        if db_field.name == 'category':\n            kwargs['widget'] = ModelSelect2Widget(\n                model=se_models.Category,\n                search_fields=[\n                    'name__icontains',\n                    'pk__startswith',\n                ],\n            )\n        return super(ProductInline, self).formfield_for_dbfield(\n            db_field,\n            **kwargs,\n        )\n\n\nclass PositionInline(admin.StackedInline):\n\n    model = Position\n\n\nclass CategoryPageAdmin(models.CategoryPageAdmin):\n\n    add = False\n    delete = False\n    inlines = [CategoryInline, inlines.ImageInline]\n\n    def get_queryset(self, request):\n        return (\n            super(CategoryPageAdmin, self)\n            .get_queryset(request)\n            .select_related('shopelectro_category')\n        )\n\n\nclass ProductPageAdmin(models.ProductPageAdmin):\n\n    add = False\n    delete = False\n    category_page_model = se_models.CategoryPage\n    list_filter = [*models.ProductPageAdmin.list_filter, HasTagsFilter, HasCategoryFilter]\n    inlines = [ProductInline, inlines.ImageInline]\n    search_fields = [\n        'shopelectro_product__vendor_code', 'name', 'slug',\n    ]\n\n    def model_id(self, obj):\n        return obj.model.vendor_code\n\n    model_id.short_description = _('Vendor code')\n    model_id.admin_order_field = 'shopelectro_product__vendor_code'\n\n    def get_queryset(self, request):\n        return (\n            super(ProductPageAdmin, self)\n            .get_queryset(request)\n            .select_related('shopelectro_product')\n        )\n\n\nclass ProductFeedbackPageAdmin(admin.ModelAdmin):\n\n    add = False\n    delete = False\n    list_filter = ['rating']\n    list_display = ['rating', 'name', 'dignities', 'limitations', 'general', 'links']\n\n    def links(self, obj):\n        return format_html(\n            '''\n            <a href=\"{url}\" class=\"field-link\" title=\"\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435\" target=\"_blank\">\n              <i class=\"fa fa-link\" aria-hidden=\"true\"></i>\n            </a>\n            '''.format(url=obj.product.url))\n\n    links.short_description = _('Link')\n\n    def get_queryset(self, request):\n        return (\n            super(ProductFeedbackPageAdmin, self)\n            .get_queryset(request)\n            .select_related('product')\n        )\n\n\nclass TagGroupAdmin(admin.ModelAdmin):\n\n    list_display = ['id', 'name', 'position', 'count_tags']\n    list_display_links = ['name']\n\n    inlines = [TagInline]\n\n    def get_queryset(self, request):\n        return super(TagGroupAdmin, self).get_queryset(request).prefetch_related('tags')\n\n    def count_tags(self, obj):\n        return obj.tags.count()\n\n\nclass TagAdmin(admin.ModelAdmin):\n\n    search_fields = ['id', 'name']\n    list_display = ['id', 'name', 'position', 'custom_group']\n    list_display_links = ['name']\n\n    def get_queryset(self, request):\n        return super(TagAdmin, self).get_queryset(request).prefetch_related('group')\n\n    def custom_group(self, obj):\n        group = obj.group\n\n        return format_html(\n            '<a href=\"{url}\">{group}</a>',\n            group=group,\n            url=reverse('admin:shopelectro_taggroup_change', args=(group.id, ))\n        )\n\n    custom_group.admin_order_field = 'group'\n    custom_group.short_description = _('Group')\n\n\nclass OrderAdmin(mixins.PermissionsControl):\n\n    add = False\n    inlines = [PositionInline]\n    list_display = ['name', 'email', 'phone', 'address', 'city', 'payment_type', 'paid']\n    search_fields = ['name', 'email', 'phone']\n    list_display_links = ['name']\n\nse_admin = SEAdminSite(name='se_admin')\nse_admin.register(CustomPage, models.CustomPageAdmin)\nse_admin.register(FlatPage, models.FlatPageAdmin)\nse_admin.register(PageTemplate, models.CustomPageTemplateAdmin)\n\nse_admin.register(se_models.CategoryPage, CategoryPageAdmin)\nse_admin.register(se_models.Order, OrderAdmin)\nse_admin.register(se_models.ProductPage, ProductPageAdmin)\nse_admin.register(se_models.ProductFeedback, ProductFeedbackPageAdmin)\nse_admin.register(se_models.TagGroup, TagGroupAdmin)\nse_admin.register(se_models.Tag, TagAdmin)\n\nse_admin.register(Redirect)\n", "path": "shopelectro/admin.py"}]}