mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-20 13:29:37 +02:00
Region dataset
This commit is contained in:
parent
5df1c4cba9
commit
6e9724979a
7 changed files with 205 additions and 28 deletions
|
@ -21,8 +21,8 @@ class AdventureAdmin(admin.ModelAdmin):
|
|||
|
||||
|
||||
class CountryAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'country_code', 'continent', 'number_of_regions')
|
||||
list_filter = ('continent', 'country_code')
|
||||
list_display = ('name', 'country_code', 'number_of_regions')
|
||||
list_filter = ('country_code', 'subregion')
|
||||
|
||||
def number_of_regions(self, obj):
|
||||
return Region.objects.filter(country=obj).count()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue