Monday, April 3, 2017

Re: Will function based views ever be deprecated?

I'm about to start a new website and I'll make it a point to use some
generic class based views when I think they are appropriate. I'll also
try and move my custom user application that I use for all of my
projects over to class based views as wells. Especially as the login()
and logout() functions are being deprecated in the next release and
being replace with class based views.

I'm sure I'll get the hang of them. I think the main problem I have is
that I haven't memorised them yet. I've pretty much memorised everything
that I need to do with function based views (with a few exceptions which
are not that hard to look up). I guess once I have memorised everything
that I need to know I'll be back being productive with them.

Hopefully it all goes OK :).

On 03/04/2017 21:09, Andréas Kühne wrote:
> I really think you should revisit CBV's - you don't have to use the
> generic views unless they make sense. I regularly override most of my
> own with mixins and the like. And like you said - querying the database
> and returning a template is probably one of the most common things I do.
> That's a detail view and 3 rows of code.
>
> I understand that you like the way you work - but I think CBV's is
> probably one of the greatest additions to django - mostly because of
> mixins and inheritance.
>
> Regarding the need to use 2 forms in the same view - I haven't stumbled
> across that usecase yet - but I probably wouldn't have an issue in CBV's
> either - but couldn't use the generic FormView for that though.
>
> Regards,
>
> Andréas
>


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f0d0f32e-b1ca-5076-20c6-63ff7feb8d9b%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment