prog.Dusan
prog.Dusan

Reputation: 1424

Can I make a view using UpdateView and DeleteView together?

I am looking for some information about generic views in django.

I want a page that will render a form for an object. On my page I want one submit button to update the object and another submit button that will delete the object.

Is it a possible to do this using a single view?

Upvotes: 0

Views: 1538

Answers (1)

Aidan Ewen
Aidan Ewen

Reputation: 13308

Yes this is possible. It is possible create a view to handle update and delete functionality using both class based views and function based views. You will find it much easier using function based views. (I'm not sure what you mean by 'merge' DeleteView and UpdateView, but if you're talking about inheritance then no you can't do that).

See this question for starters.

Upvotes: 1

Related Questions