Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 03a523db70
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (38 sloc) 1.748 kb
from django.contrib import admin
from models import *
class CountryAdmin(admin.ModelAdmin):
list_display = ['name', 'code', 'tld', 'population']
search_fields = ['name', 'code', 'tld'], CountryAdmin)
class RegionBaseAdmin(admin.ModelAdmin):
ordering = ['name_std']
list_display = ['name_std', 'parent', 'code']
search_fields = ['name', 'name_std', 'code']
class RegionAdmin(RegionBaseAdmin): pass, RegionAdmin)
class SubregionAdmin(RegionBaseAdmin):
raw_id_fields = ['region'], SubregionAdmin)
class CityBaseAdmin(admin.ModelAdmin):
ordering = ['name_std']
list_display = ['name_std', 'parent', 'population']
search_fields = ['name', 'name_std']
class CityAdmin(CityBaseAdmin):
raw_id_fields = Region.levels, CityAdmin)
class DistrictAdmin(CityBaseAdmin):
raw_id_fields = ['city'], DistrictAdmin)
class GeoAltNameAdmin(admin.ModelAdmin):
ordering = ['name']
list_display = ['name', 'geo', 'is_preferred', 'is_short']
list_filter = ['is_preferred', 'is_short']
search_fields = ['name']
raw_id_fields = ['geo']
[, GeoAltNameAdmin) for locales in geo_alt_names.values() for geo_alt_name in locales.values()]
class PostalCodeAdmin(admin.ModelAdmin):
ordering = ['code']
list_display = ['code', 'name', 'region_name', 'subregion_name', 'district_name']
search_fields = ['code', 'name', 'region_name', 'subregion_name', 'district_name']
raw_id_fields = Region.levels
[, PostalCodeAdmin) for postal_code in postal_codes.values()]
Jump to Line
Something went wrong with that request. Please try again.