27 lines
542 B
Python
27 lines
542 B
Python
from django.contrib import admin
|
|
|
|
from gallery.models import City, Location
|
|
|
|
# Register your models here.
|
|
|
|
|
|
|
|
class CityAdmin(admin.ModelAdmin):
|
|
list_display = ('name',)
|
|
search_fields = ('name',)
|
|
ordering = ('name',)
|
|
list_per_page = 30
|
|
|
|
|
|
admin.site.register(City, CityAdmin)
|
|
|
|
|
|
class LocationAdmin(admin.ModelAdmin):
|
|
list_display = ('city', 'place')
|
|
list_filter = ('city',)
|
|
ordering = ('city__name',)
|
|
search_fields = ('place', 'city__name',)
|
|
list_per_page = 30
|
|
|
|
|
|
admin.site.register(Location, LocationAdmin)
|