0
我正在迁移我们的旧应用程序到Django 1.6。django迁移到1.6的旧应用程序:ListView
现在,一些观点已经被编程这样:
from django.views.generic.list_detail import object_list
@render_to("items/index.html")
def index(request):
profile = request.user.get_profile()
args = clean_url_encode(request.GET.copy().urlencode())
context = {
'is_dashboard': True,
'body_id': 'dashboard',
'object_list': None,
'args':args,
'show_in_process':False
}
return context
我知道,我现在需要使用新的ListView,但实例和文档似乎不告诉我,我有这种特殊情况下:在上下文中传递object_list。
我该如何调整此代码以使用基于类的新通用视图?我是否也可以只使用ListView.asView()
而不是'object_list':None ?
感谢@tuxcanfly,所以如果我没有理解好,每一个这样的功能变成了自己的视图类?这将是相当多的迁移我们... – faboolous
我明白了。不是所有的功能,只是通用的看法。 – faboolous