Show country on the store list.

This commit is contained in:
2013-04-03 00:53:52 +01:00
parent 7ef47c3cc4
commit 78f793044f
2 changed files with 3 additions and 2 deletions

View File

@@ -47,13 +47,14 @@
{% if store_list.count %}
<table class="table table-striped">
<thead>
<tr><th>Name</th><th>Town/City</th></tr>
<tr><th>Name</th><th>Town/City</th><th>Country</th></tr>
</thead>
<tbody>
{% for store in store_list %}
<tr>
<td><a href="{% url "store-detail" store.slug %}">{{ store }}</a></td>
<td>{{ store.address.city }}</td>
<td>{{ store.address.country }}</td>
</tr>
{% endfor %}
</tbody>

View File

@@ -24,7 +24,7 @@ class StoreListView(HaystackSearchListMixin, ListView):
def get_queryset(self):
qs = super(StoreListView, self).get_queryset()
return qs.filter(active=True).select_related('address')
return qs.filter(active=True).select_related('address', 'address__country')
class StoreDetailView(EditorCheckMixin, DetailView):