views.py でクラスベースのジェネリック ビューを呼び出したい
私のコードを見てください...
urls.py
from django.conf.urls import patterns, include, url
from crm.views import *
urlpatterns = patterns('',
(r'^workDailyRecord/$', workDailyRecord),
)
そして私のviews.py ....見てください...
ビュー.py
from django.views.generic import TodayArchiveView
from crm.models import *
def workDailyRecord(request):
if request.method == 'GET':
tView.as_view() # I want call class-based generic views at this line.
elif:
"""
Probably this part will be code that save the data.
"""
pass
class tView(TodayArchiveView):
model = WorkDailyRecord
context_object_name = 'workDailyRecord'
date_field = 'date'
template_name = "workDailyRecord.html"
私は何をすべきか?