return similar features correctly
This commit is contained in:
parent
3a2c3852f4
commit
60ac6d466f
|
@ -30,11 +30,19 @@ 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()
|
||||||
|
d = []
|
||||||
for s in similar_features:
|
for s in similar_features:
|
||||||
s['feature_type'] = FeatureType.objects.get(pk=s.feature_type_id)
|
d.append({
|
||||||
|
'id': s.id,
|
||||||
|
'feature_type': FeatureType.objects.get(pk=s.feature_type_id)
|
||||||
|
'preferred_name': s.preferred_name,
|
||||||
|
'similarity': s.similarity,
|
||||||
|
'distance': s.distance
|
||||||
|
})
|
||||||
|
|
||||||
return render_to_response("search_related.html", {
|
return render_to_response("search_related.html", {
|
||||||
'feature': feature,
|
'feature': feature,
|
||||||
'similar_features': similar_features
|
'similar_features': d
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user