Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1362 -- Fixed old-style DB API usage in create_…

…update generic views.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2317 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7e70c7daccfa775e23ba2a8deec4f8b9dcc24c60 1 parent 3794280
Adrian Holovaty authored February 17, 2006

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django/views/generic/create_update.py
6  django/views/generic/create_update.py
@@ -39,7 +39,7 @@ def create_object(request, model, template_name=None,
39 39
             new_object = manipulator.save(new_data)
40 40
 
41 41
             if not request.user.is_anonymous():
42  
-                request.user.add_message("The %s was created sucessfully." % model._meta.verbose_name)
  42
+                request.user.message_set.add(message="The %s was created sucessfully." % model._meta.verbose_name)
43 43
 
44 44
             # Redirect to the new object: first by trying post_save_redirect,
45 45
             # then by obj.get_absolute_url; fail if neither works.
@@ -110,7 +110,7 @@ def update_object(request, model, object_id=None, slug=None,
110 110
             manipulator.save(new_data)
111 111
 
112 112
             if not request.user.is_anonymous():
113  
-                request.user.add_message("The %s was updated sucessfully." % model._meta.verbose_name)
  113
+                request.user.message_set.add(message="The %s was updated sucessfully." % model._meta.verbose_name)
114 114
 
115 115
             # Do a post-after-redirect so that reload works, etc.
116 116
             if post_save_redirect:
@@ -177,7 +177,7 @@ def delete_object(request, model, post_delete_redirect,
177 177
     if request.META['REQUEST_METHOD'] == 'POST':
178 178
         object.delete()
179 179
         if not request.user.is_anonymous():
180  
-            request.user.add_message("The %s was deleted." % model._meta.verbose_name)
  180
+            request.user.message_set.add(message="The %s was deleted." % model._meta.verbose_name)
181 181
         return HttpResponseRedirect(post_delete_redirect)
182 182
     else:
183 183
         if not template_name:

0 notes on commit 7e70c7d

Please sign in to comment.
Something went wrong with that request. Please try again.