Implemented dajax and moved models to media rather than static

This commit is contained in:
2013-08-17 21:12:21 +10:00
parent 88fe7b7e79
commit 59bab5fc10
106 changed files with 12547 additions and 12 deletions

31
three_d_viewer/views.py Normal file
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'