From 3933e87dfb9de0b89ad58285a6fb34c70f3f37c0 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 31 Aug 2011 02:07:42 +0530 Subject: [PATCH] make URI field in Authority Record admin widet --- gazetteer/places/admin.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/gazetteer/places/admin.py b/gazetteer/places/admin.py index 9736df0..d8fc858 100644 --- a/gazetteer/places/admin.py +++ b/gazetteer/places/admin.py @@ -42,7 +42,28 @@ class FeatureTypeFilter(SimpleListFilter): return queryset.filter(feature_type=val) ''' +class authRecordForm(forms.ModelForm): + uri = forms.CharField(label="URI", required=True, widget=forms.TextInput(attrs={'size': '40'})) + + class Meta: + model = AuthorityRecord + +class featuresForm(forms.ModelForm): + url = forms.CharField(label='URI', + required=True, + widget=forms.TextInput(attrs={'size': '40'})) + authority_record = AutoCompleteSelectField('authority_record', required=False) + time_frame = AutoCompleteSelectField('time_frame', required=False) + feature_type = AutoCompleteSelectField('feature_type', required=False) + +# exclude = ('info',) + + class Meta: + model = Feature + + class AuthorityRecordAdmin(admin.ModelAdmin): + form = authRecordForm search_fields = ['preferred_name'] @@ -56,18 +77,6 @@ class FeatureRelationInline(admin.TabularInline): fk_name = 'feature1' -class featuresForm(forms.ModelForm): - url = forms.CharField(label='URI', - required=True, - widget=forms.TextInput(attrs={'size': '40'})) - authority_record = AutoCompleteSelectField('authority_record', required=False) - time_frame = AutoCompleteSelectField('time_frame', required=False) - feature_type = AutoCompleteSelectField('feature_type', required=False) - -# exclude = ('info',) - - class Meta: - model = Feature class FeatureAdmin(admin.OSMGeoAdmin):