diff options
Diffstat (limited to 'apps/locations')
-rw-r--r-- | apps/locations/admin.py | 7 | ||||
-rw-r--r-- | apps/locations/models.py | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/apps/locations/admin.py b/apps/locations/admin.py index 7fcfee5..77d1bb3 100644 --- a/apps/locations/admin.py +++ b/apps/locations/admin.py @@ -136,7 +136,7 @@ admin.site.register(Country,CountryAdmin) class StateAdmin(OSMGeoAdmin): # Standard Django Admin Options - list_display = ('name','slug','country') + list_display = ('name','code','slug','country') prepopulated_fields = {'slug': ('name',)} search_fields = ('name','country') ordering = ('name',) @@ -144,7 +144,7 @@ class StateAdmin(OSMGeoAdmin): search_fields = ['name',] list_select_related = True fieldsets = ( - ('Location', {'fields': ('name','slug','pub_date','country'), 'classes': ('show','extrapretty')}), + ('Location', {'fields': ('name','slug','code','pub_date','country'), 'classes': ('show','extrapretty')}), ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}), ) extra_js = [GMAP.api_url + GMAP.key] @@ -238,4 +238,5 @@ class LocationAdmin(OSMGeoAdmin): # Finally, with these options set now register the model # associating the Options with the actual model -admin.site.register(Location,LocationAdmin)
\ No newline at end of file +admin.site.register(Location,LocationAdmin) + diff --git a/apps/locations/models.py b/apps/locations/models.py index 57806a2..47c5d65 100644 --- a/apps/locations/models.py +++ b/apps/locations/models.py @@ -126,6 +126,7 @@ class State(models.Model): name = models.CharField(max_length=250, blank=True, null=True,) country = models.ForeignKey(Country) slug = models.SlugField() + code = models.CharField(max_length=2, null=True, blank=True) pub_date = models.DateTimeField('Date published',null=True) geometry = models.MultiPolygonField(srid=4326,null=True) objects = models.GeoManager() |