From 459e38e7584ccd3683e81193c16b90c447029706 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 31 Aug 2011 04:06:08 +0530 Subject: [PATCH] features in relationship admin ajax_selects --- gazetteer/places/admin.py | 8 +++++++- gazetteer/settings.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gazetteer/places/admin.py b/gazetteer/places/admin.py index d8fc858..a0c96a8 100644 --- a/gazetteer/places/admin.py +++ b/gazetteer/places/admin.py @@ -59,8 +59,14 @@ class featuresForm(forms.ModelForm): # exclude = ('info',) class Meta: - model = Feature + model = Feature +class relationsForm(forms.ModelForm): + feature1 = AutoCompleteSelectField('feature', required=True) + feature2 = AutoCompleteSelectField('feature', required=True) + + class Meta: + model = Relationship class AuthorityRecordAdmin(admin.ModelAdmin): form = authRecordForm diff --git a/gazetteer/settings.py b/gazetteer/settings.py index 31aaa7b..1761040 100644 --- a/gazetteer/settings.py +++ b/gazetteer/settings.py @@ -89,6 +89,7 @@ AJAX_LOOKUP_CHANNELS = { 'authority_record' : dict(model='places.authorityrecord', search_field='preferred_name'), 'time_frame': dict(model='places.timeframe', search_field='description'), 'feature_type': ('places.lookups', 'FeatureTypeLookup'), + 'feature': dict(model='places.feature', search_field='preferred_name'), # this generates a simple channel # specifying the model Track in the music app, and searching against the 'title' field