From 435e9e9c21090866ce0bfc56d5093535e1db211c Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 30 Aug 2011 15:35:45 +0530 Subject: [PATCH] admin changes --- gazetteer/places/admin.py | 6 +++++- gazetteer/places/models.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gazetteer/places/admin.py b/gazetteer/places/admin.py index db0ead3..7646236 100644 --- a/gazetteer/places/admin.py +++ b/gazetteer/places/admin.py @@ -40,6 +40,10 @@ class FeatureTypeFilter(SimpleListFilter): return queryset.filter(feature_type=val) ''' +class AuthorityRecordAdmin(admin.ModelAdmin): + search_fields = ['preferred_name'] + + class FeatureNamesInline(admin.StackedInline): model = Name extra = 0 @@ -83,4 +87,4 @@ admin.site.register(Feature, FeatureAdmin) admin.site.register(TimeFrame) admin.site.register(FeatureType, FeatureTypeAdmin) admin.site.register(Relationship) -admin.site.register(AuthorityRecord) +admin.site.register(AuthorityRecord, AuthorityRecordAdmin) diff --git a/gazetteer/places/models.py b/gazetteer/places/models.py index cd9ec97..1801550 100644 --- a/gazetteer/places/models.py +++ b/gazetteer/places/models.py @@ -160,6 +160,9 @@ class TimeFrame(models.Model): start_granularity = models.CharField(max_length=64, choices=GRANULARITY_CHOICES) end_granularity = models.CharField(max_length=64, choices=GRANULARITY_CHOICES) + class Meta: + ordering = ['description'] + def __unicode__(self): return self.description