Browse files

Fixed #2141 -- corrected indentation problems in a couple of the code…

… fragments.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3126 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 97fedcc commit ed1dcbf3e7313ea4bb779210f09cf3e4c7e7956f @malcolmt malcolmt committed Jun 14, 2006
Showing with 9 additions and 9 deletions.
  1. +9 −9 docs/model-api.txt
View
18 docs/model-api.txt
@@ -1634,22 +1634,22 @@ to happen whenever you save an object. For example::
name = models.CharField(maxlength=100)
tagline = models.TextField()
- def save(self):
- do_something()
- super(Blog, self).save() # Call the "real" save() method.
- do_something_else()
+ def save(self):
+ do_something()
+ super(Blog, self).save() # Call the "real" save() method.
+ do_something_else()
You can also prevent saving::
class Blog(models.Model):
name = models.CharField(maxlength=100)
tagline = models.TextField()
- def save(self):
- if self.name == "Yoko Ono's blog":
- return # Yoko shall never have her own blog!
- else:
- super(Blog, self).save() # Call the "real" save() method.
+ def save(self):
+ if self.name == "Yoko Ono's blog":
+ return # Yoko shall never have her own blog!
+ else:
+ super(Blog, self).save() # Call the "real" save() method.
.. _database API docs: http://www.djangoproject.com/documentation/db_api/

0 comments on commit ed1dcbf

Please sign in to comment.