开发者

Django - Can't import ListView and DetailView classes

I'm going through Django tutorial (part 4 - http://docs.djangoproject.com/en/dev/intro/tutorial04/) and need to import this:

from django.views.generic import DetailView, ListView

I copypasted code snippet with this import line, but PyDev underscored DetailView and ListView as unresolved import. I opened module django.views.generic and saw that the only thin开发者_如何学Pythong it contain is:

class GenericViewError(Exception):
    """A problem in a generic view."""
    pass

Neither DetailView, nor ListView, nor something other at all.

What's wrong? (I use django ver. 1.2.5)


I found the answer - tutorial I use is for the development version (latest for this moment - 1.3).

For the strange reasons I ignored the notice on each tutorial page:

"This document is for Django's development version, which can be significantly different from previous releases. Get older docs here: 1.2, 1.1, 1.0"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜