While this doesn't contribute an answer to your question, I must say
that name "class-based generic views" is a bit misleading . . .
implying that these class-based views are for doing things you want to
do that follow a strictly set pattern out of the box (i.e, listviews,
detailviews, create views, etc.), but that you'll have to use
something else (i.e., function based views) if you are defining your
own views.  However, this is not the case at all.  We wanted to switch
all our views to class-based, and have had great success with writing
our own class-based views by extending built-in view and mixin
classes.  Basically, most of our own views extend the generic
TemplateView and we add in our own Mixins or add functionality to the
overridden class methods. Some of our views extend other generic view
classes. As the documentation gets updated and edited, this paradigm
probably ought to be explained, because for a while I just figured
that i still had to still use function views if I wanted to do
anything custom, beyond what the generic views provide in and of
themselves.  They're a different beast but can be much more DRY and
add some OO awesomeness to your code once you get your head around
them.  For now, I'd recommend looking at the source code to see which
functions you can override, its pretty straightforward.

Ben

On Jul 16, 12:26 pm, Paul Walsh <paulywa...@gmail.com> wrote:
> Hi Russ,
>
> Wow - your response is *exactly* what I needed - thanks a great deal :)
>
> As you mention in there, *because* CreateView gets me so far without the
> Form class (it builds me a form based on the model I declare), I was exactly
> looking to do other "ModelForm" stuff at the CreateView level.
>
> Now it is clear to me what I need to do. Thanks for your class-based generic
> views contribution, and I really hope someone will have the chance to do
> more docs and examples for class-based views.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to