﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22768	CreateUpdateView view class	adi.andreias@…	nobody	"I think it makes sense to have a Class-based view for both updating and creating model objects.

BaseUpdateView and BaseCreateView differ by just two lines, one in get() and one in post():
https://github.com/django/django/blob/1.7b4/django/views/generic/edit.py#L218
https://github.com/django/django/blob/1.7b4/django/views/generic/edit.py#L195

A CreateUpdateView view would distinguish between create and update based on a slug, pk or similar (configurable?) parameter in url.

There are situations where the view class contains a lot of code logic (like a secondary formset, ajax requests handled along with regular requests, etc.) and having separate classes for create and update would result in duplicate code.

I also think this is a common pattern and deserves to be added to Django core."	New feature	closed	Generic views	dev	Normal	wontfix	CBV class based view update create CreateUpdateView		Unreviewed	0	0	0	0	1	0
