We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e10a52d commit 5f9eed9Copy full SHA for 5f9eed9
easy_maps_tests/test_app/models.py
@@ -1 +1,27 @@
1
#hello, testrunner!
2
+from django.db import models
3
+from django.contrib import admin
4
+
5
+from easy_maps.models import Address
6
+from easy_maps.admin import AddressInlineAdmin
7
8
+class Brand(models.Model):
9
+ name = models.CharField(max_length=100)
10
11
+ def count(self):
12
+ return self.shop_set.count()
13
14
+class Shop(Address):
15
+ brand = models.ForeignKey(Brand)
16
17
+class ShopInlineAdmin(AddressInlineAdmin):
18
+ model = Shop
19
20
+class BrandAdmin(admin.ModelAdmin):
21
+ list_display = ['name', 'count',]
22
+ model = Brand
23
+ inlines = [
24
+ ShopInlineAdmin,
25
+ ]
26
27
+admin.site.register(Brand, BrandAdmin)
0 commit comments