Index: django/views/generic/create_update.py
===================================================================
--- django/views/generic/create_update.py	(revision 6635)
+++ django/views/generic/create_update.py	(working copy)
@@ -1,7 +1,6 @@
 from django.core.xheaders import populate_xheaders
 from django.template import loader
-from django import oldforms
-from django.db.models import FileField
+from django import newforms as forms
 from django.contrib.auth.views import redirect_to_login
 from django.template import RequestContext
 from django.http import Http404, HttpResponse, HttpResponseRedirect
@@ -10,7 +9,8 @@
 
 def create_object(request, model, template_name=None,
         template_loader=loader, extra_context=None, post_save_redirect=None,
-        login_required=False, follow=None, context_processors=None):
+        login_required=False, context_processors=None,
+        save_callback=lambda form, request: form.save(), **kwargs):
     """
     Generic object-creation function.
 
@@ -23,22 +23,14 @@
     if login_required and not request.user.is_authenticated():
         return redirect_to_login(request.path)
 
-    manipulator = model.AddManipulator(follow=follow)
-    if request.POST:
-        # If data was POSTed, we're trying to create a new object
-        new_data = request.POST.copy()
-
-        if model._meta.has_field_type(FileField):
-            new_data.update(request.FILES)
-
-        # Check for errors
-        errors = manipulator.get_validation_errors(new_data)
-        manipulator.do_html2python(new_data)
-
-        if not errors:
-            # No errors -- this means we can save the data!
-            new_object = manipulator.save(new_data)
-
+    ModelForm = forms.form_for_model(model, **kwargs)
+    
+    if request.method == 'POST':
+        form = ModelForm(request.POST, request.FILES)
+        
+        if form.is_valid():
+            new_object = save_callback(form, request)
+            
             if request.user.is_authenticated():
                 request.user.message_set.create(message=ugettext("The %(verbose_name)s was created successfully.") % {"verbose_name": model._meta.verbose_name})
 
@@ -51,12 +43,9 @@
             else:
                 raise ImproperlyConfigured("No URL to redirect to from generic create view.")
     else:
-        # No POST, so we want a brand new form without any data or errors
-        errors = {}
-        new_data = manipulator.flatten_data()
+        form = ModelForm()
 
-    # Create the FormWrapper, template, context, response
-    form = oldforms.FormWrapper(manipulator, new_data, errors)
+    # Create the template, context, response
     if not template_name:
         template_name = "%s/%s_form.html" % (model._meta.app_label, model._meta.object_name.lower())
     t = template_loader.get_template(template_name)
@@ -73,8 +62,9 @@
 def update_object(request, model, object_id=None, slug=None,
         slug_field='slug', template_name=None, template_loader=loader,
         extra_context=None, post_save_redirect=None,
-        login_required=False, follow=None, context_processors=None,
-        template_object_name='object'):
+        login_required=False, context_processors=None,
+        template_object_name='object',
+        save_callback=lambda form, request: form.save(), **kwargs):
     """
     Generic object-update function.
 
@@ -102,16 +92,12 @@
     except ObjectDoesNotExist:
         raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs)
 
-    manipulator = model.ChangeManipulator(getattr(object, object._meta.pk.attname), follow=follow)
+    ModelForm = forms.form_for_instance(object, **kwargs)
 
-    if request.POST:
-        new_data = request.POST.copy()
-        if model._meta.has_field_type(FileField):
-            new_data.update(request.FILES)
-        errors = manipulator.get_validation_errors(new_data)
-        manipulator.do_html2python(new_data)
-        if not errors:
-            object = manipulator.save(new_data)
+    if request.method == 'POST':
+        form = ModelForm(request.POST, request.FILES)
+        if form.is_valid():
+            object = save_callback(form, request)
 
             if request.user.is_authenticated():
                 request.user.message_set.create(message=ugettext("The %(verbose_name)s was updated successfully.") % {"verbose_name": model._meta.verbose_name})
@@ -124,11 +110,8 @@
             else:
                 raise ImproperlyConfigured("No URL to redirect to from generic create view.")
     else:
-        errors = {}
-        # This makes sure the form acurate represents the fields of the place.
-        new_data = manipulator.flatten_data()
+        form = ModelForm()
 
-    form = oldforms.FormWrapper(manipulator, new_data, errors)
     if not template_name:
         template_name = "%s/%s_form.html" % (model._meta.app_label, model._meta.object_name.lower())
     t = template_loader.get_template(template_name)
Index: tests/regressiontests/views/tests/__init__.py
===================================================================
--- tests/regressiontests/views/tests/__init__.py	(revision 6635)
+++ tests/regressiontests/views/tests/__init__.py	(working copy)
@@ -1,4 +1,5 @@
 from defaults import *
 from i18n import *
 from static import *
-from generic.date_based import *
\ No newline at end of file
+from generic.date_based import *
+from generic.create_update import *
\ No newline at end of file
Index: tests/regressiontests/views/tests/generic/create_update.py
===================================================================
--- tests/regressiontests/views/tests/generic/create_update.py	(revision 0)
+++ tests/regressiontests/views/tests/generic/create_update.py	(revision 0)
@@ -0,0 +1,102 @@
+
+import datetime
+from django.test import TestCase 
+from django.contrib.auth.views import redirect_to_login
+from regressiontests.views.models import Article, Author
+
+class CreateObjectTest(TestCase):
+    fixtures = ['testdata.json']
+    
+    def test_not_logged_in(self):
+        """Verifies the user is logged in through the login_required kwarg"""
+        view_url = '/views/create_update/member/create/article/'
+        response = self.client.get(view_url)
+        self.assertRedirects(response, 'http://testserver/accounts/login/?next=%s' % view_url)
+    
+    def test_create_article_display_page(self):
+        """Ensures the generic view returned the page and contains a form."""
+        view_url = '/views/create_update/create/article/'
+        response = self.client.get(view_url)
+        self.assertEqual(response.status_code, 200)
+        if not response.context.get('form'):
+            self.fail('No form found in the response.')
+    
+    def test_create_article_with_errors(self):
+        """POSTs a form that contain validation errors."""
+        view_url = '/views/create_update/create/article/'
+        response = self.client.post(view_url, {
+            'title': 'My First Article',
+        })
+        self.assertFormError(response, 'form', 'slug', [u'This field is required.'])
+    
+    def test_create_article(self):
+        """Creates a new article through the generic view and ensures it gets
+        redirected to the correct URL defined by post_save_redirect"""
+        view_url = '/views/create_update/create/article/'
+        response = self.client.post(view_url, {
+            'title': 'My First Article',
+            'slug': 'my-first-article',
+            'author': '1',
+            'date_created': datetime.datetime(2007, 6, 25),
+        })
+        self.assertRedirects(response,
+            'http://testserver/views/create_update/view/article/my-first-article/',
+            target_status_code=404)
+    
+    def test_create_custom_save_article(self):
+        """Creates a new article with a custom save_callback to adjust the slug
+        before committing to the database."""
+        view_url = '/views/create_update/create_custom/article/'
+        response = self.client.post(view_url, {
+            'title': 'Test Article',
+        })
+        self.assertRedirects(response,
+            'http://testserver/views/create_update/view/article/some-other-slug/',
+            target_status_code=404)
+
+class UpdateDeleteObjectTest(TestCase):
+    fixtures = ['testdata.json']
+    
+    def test_update_object_form_display(self):
+        """Verifies that the form was created properly and with initial values."""
+        response = self.client.get('/views/create_update/update/article/old_article/')
+        self.assertEquals(unicode(response.context['form']['title']),
+            u'<input id="id_title" type="text" name="title" value="Old Article" maxlength="100" />')
+    
+    def test_update_object(self):
+        """Verifies the form POST data and performs a redirect to
+        post_save_redirect"""
+        response = self.client.post('/views/create_update/update/article/old_article/', {
+            'title': 'Another Article',
+            'slug': 'another-article-slug',
+            'author': 1,
+            'date_created': datetime.datetime(2007, 6, 25),
+        })
+        self.assertRedirects(response,
+            'http://testserver/views/create_update/view/article/another-article-slug/',
+            target_status_code=404)
+        article = Article.objects.get(pk=1)
+        self.assertEquals(article.title, "Another Article")
+    
+    def test_delete_object_confirm(self):
+        """Verifies the confirm deletion page is displayed using a GET."""
+        response = self.client.get('/views/create_update/delete/article/old_article/')
+        self.assertTemplateUsed(response, 'views/article_confirm_delete.html')
+    
+    def test_delete_object_redirect(self):
+        """Verifies that post_delete_redirect works properly."""
+        response = self.client.post('/views/create_update/delete/article/old_article/')
+        self.assertRedirects(response,
+            'http://testserver/views/create_update/',
+            target_status_code=404)
+    
+    def test_delete_object(self):
+        """Verifies the object actually gets deleted on a POST."""
+        response = self.client.post('/views/create_update/delete/article/old_article/')
+        try:
+            Article.objects.get(slug='old_article')
+        except Article.DoesNotExist:
+            pass
+        else:
+            self.fail('Object was not deleted.')
+        
\ No newline at end of file
Index: tests/regressiontests/views/views.py
===================================================================
--- tests/regressiontests/views/views.py	(revision 6635)
+++ tests/regressiontests/views/views.py	(working copy)
@@ -1,7 +1,24 @@
+import datetime
 from django.http import HttpResponse
 from django.template import RequestContext
+from django.views.generic.create_update import create_object
 
+from models import Author
+
 def index_page(request):
     """Dummy index page"""
     return HttpResponse('<html><body>Dummy page</body></html>')
 
+def custom_slug(request, **kwargs):
+    def mysave(form, request):
+        instance = form.save(commit=False)
+        instance.slug = 'some-other-slug'
+        instance.author = Author.objects.get(pk=1)
+        # this would normally be done through the default value of the field
+        # this is just here to prove that it can be done in a save_callback
+        instance.date_created = datetime.datetime.now()
+        instance.save()
+        return instance
+    return create_object(request, save_callback=mysave,
+        fields=('title',), **kwargs)
+
Index: tests/regressiontests/views/urls.py
===================================================================
--- tests/regressiontests/views/urls.py	(revision 6635)
+++ tests/regressiontests/views/urls.py	(working copy)
@@ -20,6 +20,10 @@
     'month_format': '%m', 
 } 
 
+crud_info_dict = {
+    'model': Article,
+}
+
 urlpatterns = patterns('',
     (r'^$', views.index_page),
     
@@ -44,5 +48,17 @@
         dict(allow_future=True, slug_field='slug', **date_based_info_dict)), 
     (r'^date_based/archive_month/(?P<year>\d{4})/(?P<month>\d{1,2})/$', 
         'django.views.generic.date_based.archive_month', 
-        date_based_info_dict),     
+        date_based_info_dict),
+    
+    # crud generic views
+    (r'^create_update/member/create/article/$', 'django.views.generic.create_update.create_object',
+        dict(login_required=True, **crud_info_dict)),
+    (r'^create_update/create/article/$', 'django.views.generic.create_update.create_object',
+        dict(post_save_redirect='/views/create_update/view/article/%(slug)s/', **crud_info_dict)),
+    (r'^create_update/create_custom/article/$', views.custom_slug,
+        dict(post_save_redirect='/views/create_update/view/article/%(slug)s/', **crud_info_dict)),
+    (r'create_update/update/article/(?P<slug>[-\w]+)/$', 'django.views.generic.create_update.update_object',
+        dict(post_save_redirect='/views/create_update/view/article/%(slug)s/', slug_field='slug', **crud_info_dict)),
+    (r'create_update/delete/article/(?P<slug>[-\w]+)/$', 'django.views.generic.create_update.delete_object',
+        dict(post_delete_redirect='/views/create_update/', slug_field='slug', **crud_info_dict)),
 )
Index: tests/templates/views/article_confirm_delete.html
===================================================================
--- tests/templates/views/article_confirm_delete.html	(revision 0)
+++ tests/templates/views/article_confirm_delete.html	(revision 0)
@@ -0,0 +1 @@
+This template intentionally left blank
\ No newline at end of file
Index: tests/templates/views/article_form.html
===================================================================
--- tests/templates/views/article_form.html	(revision 0)
+++ tests/templates/views/article_form.html	(revision 0)
@@ -0,0 +1 @@
+This template intentionally left blank
\ No newline at end of file
Index: docs/generic_views.txt
===================================================================
--- docs/generic_views.txt	(revision 6635)
+++ docs/generic_views.txt	(working copy)
@@ -894,14 +894,21 @@
 The ``django.views.generic.create_update`` module contains a set of functions
 for creating, editing and deleting objects.
 
+**New in Django development version:**
+
+``django.views.generic.create_update.create_object`` and
+``django.views.generic.create_update.update_object`` now use `newforms`_ to
+build and display the form.
+
+.. _newforms: ../newforms/
+
 ``django.views.generic.create_update.create_object``
 ----------------------------------------------------
 
 **Description:**
 
 A page that displays a form for creating an object, redisplaying the form with
-validation errors (if there are any) and saving the object. This uses the
-automatic manipulators that come with Django models.
+validation errors (if there are any) and saving the object.
 
 **Required arguments:**
 
@@ -938,6 +945,26 @@
     * ``context_processors``: A list of template-context processors to apply to
       the view's template. See the `RequestContext docs`_.
 
+    * **New in Django development version:** ``save_callback``: A callback
+      function to override how the form gets saved to the database.
+      
+      The ``save_callback`` function will be given a ``Form`` instance with
+      the cleaned data and the ``HttpRequest`` instance passed to the view.
+    
+    * **New in Django development version:** ``form``: A ``BaseForm`` subclass
+      to allow form customization and validation. See an example
+      `using an alternate base class`_ to fully understand the usage of this
+      argument.
+
+    * **New in Django development version:** ``fields``: A list of fields to
+      include in the ``Form`` object. See an example `using a subset of fields`_
+      for more information.
+
+    * **New in Django development version:** ``formfield_callback``: A callback
+      function to easily customize the default fields and widgets displayed
+      by the form. See an example `how to override default field types`_ for
+      more information.
+
 **Template name:**
 
 If ``template_name`` isn't specified, this view will use the template
@@ -947,22 +974,25 @@
 
 In addition to ``extra_context``, the template's context will be:
 
-    * ``form``: A ``django.oldforms.FormWrapper`` instance representing the form
+    * ``form``: A ``django.newforms.Form`` instance representing the form
       for editing the object. This lets you refer to form fields easily in the
       template system.
 
       For example, if ``model`` has two fields, ``name`` and ``address``::
 
           <form action="" method="post">
-          <p><label for="id_name">Name:</label> {{ form.name }}</p>
-          <p><label for="id_address">Address:</label> {{ form.address }}</p>
+          <p>{{ form.name.label_tag }} {{ form.name }}</p>
+          <p>{{ form.address.label_tag }} {{ form.address }}</p>
           </form>
 
-      See the `manipulator and formfield documentation`_ for more information
-      about using ``FormWrapper`` objects in templates.
+      See the `newforms documentation`_ for more information about using
+      ``Form`` objects in templates.
 
 .. _authentication system: ../authentication/
-.. _manipulator and formfield documentation: ../forms/
+.. _using an alternate base class: ../newforms/#using-an-alternate-base-class
+.. _using a subset of fields: ../newforms/#using-a-subset-of-fields-on-the-form
+.. _how to override default field types: ../newforms/#overriding-the-default-field-types
+.. _newforms documentation: ../newforms/
 
 ``django.views.generic.create_update.update_object``
 ----------------------------------------------------
@@ -1019,6 +1049,26 @@
 
     * ``template_object_name``:  Designates the name of the template variable
       to use in the template context. By default, this is ``'object'``.
+    
+    * **New in Django development version:** ``save_callback``: A callback
+      function to override how the form gets saved to the database.
+      
+      The ``save_callback`` function will be given a ``Form`` instance with
+      the cleaned data and the ``HttpRequest`` instance passed to the view.
+    
+    * **New in Django development version:** ``form``: A ``BaseForm`` subclass
+      to allow form customization and validation. See an example
+      `using an alternate base class`_ to fully understand the usage of this
+      argument.
+    
+    * **New in Django development version:** ``fields``: A list of fields to
+      include in the ``Form`` object. See an example `using a subset of fields`_
+      for more information.
+    
+    * **New in Django development version:** ``formfield_callback``: A callback
+      function to easily customize the default fields and widgets displayed
+      by the form. See an example `how to override default field types`_ for
+      more information.
 
 **Template name:**
 
@@ -1029,20 +1079,20 @@
 
 In addition to ``extra_context``, the template's context will be:
 
-    * ``form``: A ``django.oldforms.FormWrapper`` instance representing the form
+    * ``form``: A ``django.newforms.Form`` instance representing the form
       for editing the object. This lets you refer to form fields easily in the
       template system.
 
       For example, if ``model`` has two fields, ``name`` and ``address``::
 
           <form action="" method="post">
-          <p><label for="id_name">Name:</label> {{ form.name }}</p>
-          <p><label for="id_address">Address:</label> {{ form.address }}</p>
+          <p>{{ form.name.label_tag }} {{ form.name }}</p>
+          <p>{{ form.address.label_tag }} {{ form.address }}</p>
           </form>
+      
+      See the `newforms documentation`_ for more information about using
+      ``Form`` objects in templates.
 
-      See the `manipulator and formfield documentation`_ for more information
-      about using ``FormWrapper`` objects in templates.
-
     * ``object``: The original object being edited. This variable's name
       depends on the ``template_object_name`` parameter, which is ``'object'``
       by default. If ``template_object_name`` is ``'foo'``, this variable's
