Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (14 sloc) 461 Bytes
from django.views.generic.base import \
from myproject.myapp.models import TodoItem
class MyTodos(TemplateView):
"""This is a test view
Objects available to the template:
A list of :model:`myapp.TodoItem` objects.
template_name = 'my_todos.html'
def get(self, request, **kwargs):
context = {
'todos': TodoItem.objects.all()}
return self.render_to_response(context)
Something went wrong with that request. Please try again.