try to display feature name instead of id

This commit is contained in:
Sanj 2011-08-29 18:38:47 +05:30
parent 67a4a7ce94
commit b2382b96b6
3 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,8 @@ def search_related(request):
id = request.GET.get("id", "0") id = request.GET.get("id", "0")
feature = get_object_or_404(Feature, pk=id) feature = get_object_or_404(Feature, pk=id)
similar_features = feature.similar_features() 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", { return render_to_response("search_related.html", {
'feature': feature, 'feature': feature,
'similar_features': similar_features 'similar_features': similar_features

View File

@ -38,8 +38,8 @@
<table id="mapList"> <table id="mapList">
<thead> <thead>
<tr> <tr>
<td>Preferred Name</td> <td>Name</td>
<td>Feature Type</td> <td>Type</td>
<td>County</td> <td>County</td>
<td>State</td> <td>State</td>
</tr> </tr>

View File

@ -4,7 +4,7 @@
<script type="text/javascript" src="/static/js/jquery.js"></script> <script type="text/javascript" src="/static/js/jquery.js"></script>
</head> </head>
<body> <body>
<h2>Similar features for {{ feature.preferred_name }}></h2> <h2>Similar features for {{ feature.preferred_name }}:</h2>
<table id="similarTable"> <table id="similarTable">
<thead> <thead>
@ -27,10 +27,10 @@
{% for s in similar_features %} {% for s in similar_features %}
<tr> <tr>
<td> <td>
{{ s.preferred_name }} <a href="/admin/pleaces/feature/{{ s.id }}" title="View / Edit in Admin"> {{ s.preferred_name }} </a>
</td> </td>
<td> <td>
{{ s.feature_type_id }} {{ s.feature_type }}
</td> </td>
<td> <td>
{{ s.similarity }} {{ s.similarity }}