1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-20 13:29:37 +02:00

Region dataset

This commit is contained in:
Sean Morley 2024-09-10 23:00:13 -04:00
parent 5df1c4cba9
commit 6e9724979a
7 changed files with 205 additions and 28 deletions

View file

@ -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()