From b2382b96b6776c48264c18c4c66f4706eb604ac5 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 29 Aug 2011 18:38:47 +0530 Subject: [PATCH] try to display feature name instead of id --- gazetteer/places/views.py | 3 ++- gazetteer/templates/search.html | 4 ++-- gazetteer/templates/search_related.html | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gazetteer/places/views.py b/gazetteer/places/views.py index d93795f..fda8f33 100644 --- a/gazetteer/places/views.py +++ b/gazetteer/places/views.py @@ -30,7 +30,8 @@ def search_related(request): id = request.GET.get("id", "0") feature = get_object_or_404(Feature, pk=id) similar_features = feature.similar_features() - + for s in similar_features: + s['feature_type'] = FeatureType.objects.get(pk=s.feature_type_id) return render_to_response("search_related.html", { 'feature': feature, 'similar_features': similar_features diff --git a/gazetteer/templates/search.html b/gazetteer/templates/search.html index 4731112..93103e0 100644 --- a/gazetteer/templates/search.html +++ b/gazetteer/templates/search.html @@ -38,8 +38,8 @@ - - + + diff --git a/gazetteer/templates/search_related.html b/gazetteer/templates/search_related.html index 7791a16..901cbdf 100644 --- a/gazetteer/templates/search_related.html +++ b/gazetteer/templates/search_related.html @@ -4,7 +4,7 @@ -

Similar features for {{ feature.preferred_name }}>

+

Similar features for {{ feature.preferred_name }}:

Preferred NameFeature TypeNameType County State
@@ -27,10 +27,10 @@ {% for s in similar_features %}
- {{ s.preferred_name }} + {{ s.preferred_name }} - {{ s.feature_type_id }} + {{ s.feature_type }} {{ s.similarity }}