From c0dd1a7d36673e219b3f4bfc4da6e3856ac44eee Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 30 Aug 2011 19:03:38 +0530 Subject: [PATCH] add auto-complete for time-frame --- gazetteer/places/admin.py | 1 + gazetteer/settings.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gazetteer/places/admin.py b/gazetteer/places/admin.py index c2f58a7..9bd848f 100644 --- a/gazetteer/places/admin.py +++ b/gazetteer/places/admin.py @@ -61,6 +61,7 @@ class featuresForm(forms.ModelForm): required=True, widget=forms.TextInput(attrs={'size': '40'})) authority_record = AutoCompleteSelectField('authority_record', required=False) + time_frame = AutoCompleteSelectField('time_frame', required=False) # exclude = ('info',) diff --git a/gazetteer/settings.py b/gazetteer/settings.py index 7cbef9a..06ba15d 100644 --- a/gazetteer/settings.py +++ b/gazetteer/settings.py @@ -86,7 +86,8 @@ MIDDLEWARE_CLASSES = ( AJAX_LOOKUP_CHANNELS = { # the simplest case, pass a DICT with the model and field to search against : - 'authority_record' : dict(model='places.authorityrecord',search_field='preferred_name'), + 'authority_record' : dict(model='places.authorityrecord', search_field='preferred_name'), + 'time_frame': dict(model='places.timeframe', search_field='description'), # this generates a simple channel # specifying the model Track in the music app, and searching against the 'title' field