changing namespace and urls

This commit is contained in:
2013-07-27 22:23:05 +10:00
parent dd8614fdff
commit 08e36dacb1
19 changed files with 68 additions and 94 deletions

View File

@@ -0,0 +1,31 @@
from django import template
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.views import generic
from three_d_viewer.models import Sample
register = template.Library()
@register.inclusion_tag('children.html')
def children_tag(category):
children = category.children.all()
return {'children': children}
class IndexView(generic.ListView):
template_name = 'three_d_viewer/index.html'
context_object_name = 'active_samples'
def get_queryset(self):
"""
Return the last five published polls (not including those set to be
published in the future).
"""
return Sample.objects.filter(active=True)
class DetailView(generic.DetailView):
model = Sample
template_name = 'three_d_viewer/detail.html'