From 7301d5157a3c754a62ea609af292054bd692416c Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 1 Sep 2011 07:21:46 +0530 Subject: [PATCH] forget about formsets and make things work again --- gazetteer/places/admin.py | 7 ++++--- gazetteer/places/views.py | 5 +++++ gazetteer/static/js/feature_admin.js | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gazetteer/places/admin.py b/gazetteer/places/admin.py index 191e44a..586ed2d 100644 --- a/gazetteer/places/admin.py +++ b/gazetteer/places/admin.py @@ -1,6 +1,6 @@ from django.contrib.gis import admin from models import * -from forms import BaseRelationsFormSet +# from forms import BaseRelationsFormSet from django import forms #from django.contrib.admin import SimpleListFilter from ajax_select.fields import AutoCompleteSelectMultipleField, AutoCompleteSelectField @@ -82,19 +82,20 @@ class FeatureNamesInline(admin.TabularInline): model = Name extra = 0 +''' class FeatureRelationInline(admin.TabularInline): model = Feature.relationships.through extra = 1 fk_name = 'feature1' formset = BaseRelationsFormSet - +''' class FeatureAdmin(admin.OSMGeoAdmin): fields = ('preferred_name', 'feature_type', 'admin1', 'admin2', 'geometry', 'url', 'authority_record', 'time_frame', 'is_primary',) search_fields = ['preferred_name'] # list_filter = ('feature_type',) - inlines = [FeatureNamesInline, FeatureRelationInline] + inlines = [FeatureNamesInline] list_display = ('__unicode__', 'feature_type_name', 'admin1', 'admin2', 'time_start', 'time_end',) list_per_page = 30 # list_filter = (FeatureTypeFilter,) diff --git a/gazetteer/places/views.py b/gazetteer/places/views.py index dcb48ee..7e0b959 100644 --- a/gazetteer/places/views.py +++ b/gazetteer/places/views.py @@ -92,6 +92,7 @@ def search_related_json(request, id): time_frame = f.time_frame.description else: time_frame = '' + d.append({ 'id': s.id, @@ -124,3 +125,7 @@ def time_frame_json(request): } return render_to_json_response(d) + + + + diff --git a/gazetteer/static/js/feature_admin.js b/gazetteer/static/js/feature_admin.js index b70d30f..facbac9 100644 --- a/gazetteer/static/js/feature_admin.js +++ b/gazetteer/static/js/feature_admin.js @@ -34,3 +34,5 @@ function getRow(d) { return $tr; } + +