Minerals now show their detail. The layout still needs work to get it showing correctly though.

This commit is contained in:
2014-01-21 23:54:09 +10:00
parent d5867c8d4a
commit 9509d788c0
8 changed files with 101 additions and 8 deletions

View File

@@ -48,4 +48,14 @@ class MineralDetailView(DetailView):
"""
model = Mineral
template_name = 'three_d_viewer/mineral_detail.html'
template_name = 'three_d_viewer/mineral_detail.html'
parent_categories = Category.objects.filter(parent=None). \
filter(active=True).order_by("name")
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)
context['active_samples'] = Sample.objects.select_subclasses(Mineral).filter(active=True).order_by('name')
context['parent_categories'] = Category.objects.filter(parent=None). \
filter(active=True).order_by('name')
return context