0

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?

Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88
prog.Dusan
  • 1,324
  • 2
  • 12
  • 25
  • for django 1.5 - https://docs.djangoproject.com/en/1.5/topics/class-based-views/generic-editing/ – Aidan Ewen Feb 22 '13 at 13:34
  • Yes, I read these documentations, but I want make one view and merge DeleteView and UpdateView, and monitoring with two submit button. It is a possible or no? – prog.Dusan Feb 22 '13 at 13:54
  • 1
    you can't do that in class based but it is possible in function based – catherine Feb 28 '13 at 07:55

1 Answers1

1

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.

Community
  • 1
  • 1
Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88