We call it function based view. Method are function attached to an object.

As far as I know, there is no plan to remove function based view.



But in my opinion, you should definitely have a look at class based
view. They really shine in common task.

An example, a view to create an object will take something like 10 to
20 lines of code in function based view. You need to treat the case of
showing the form, handling a valid form, handling a form with
validation error.
With class based view, that's 4 lines. Declare a class inheriting from
UpdateView, define the url to redirect to in case of valid form, which
model to update and which field to update.

So sure, they are redundant. But they save a lot of time, make the
code easier to understand and prevent error in commons case.

2017-02-11 23:16 GMT+01:00  <shahab.emam...@gmail.com>:
> hello
>
> i have learned some django and but i write my views in method base views.
>
> i dont now how to use class base views and i am not interested to learn
> class base views
> because i think it's redundant .
>
> do i have to learn it ?
> i that possible method base views will remove in next version of django?
> thanks
>
> --
> 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+unsubscr...@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/8c81adf0-06e3-400c-beb3-07155e26fa25%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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+unsubscr...@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/CAEuG%2BTYWoywm5FvkpfVg%3D1J5BUkqcn0KwOKvweOHx8mS%3DfF_tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to