Commit a8461551 authored by Adrian Holovaty's avatar Adrian Holovaty
Browse files

Small formatting changes to model unit tests to make them look better in the model examples online

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 3daae59a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
"""
3. Giving models custom methods and custom managers
3. Giving models custom methods

Any method you add to a model will be available to instances.
"""
+2 −2
Original line number Diff line number Diff line
"""
27. Many-to-many and many-to-one relationships to the same table.
27. Many-to-many and many-to-one relationships to the same table

This is a response to bug #1535

+12 −13
Original line number Diff line number Diff line
"""
20. Object Pagination

Django provides a framework for paginating a list of objects in a few.  
This is often useful for dividing search results or long lists of objects
in to easily readable pages.

28. Object pagination

Django provides a framework for paginating a list of objects in a few lines
of code. This is often useful for dividing search results or long lists of
objects into easily readable pages.
"""

from django.db import models

class Article(models.Model):
+1 −1
Original line number Diff line number Diff line
"""
XXX. Transactions
15. Transactions

Django handles transactions in three different ways. The default is to commit
each transaction upon a write, but you can decorate a function to get
+3 −1
Original line number Diff line number Diff line
"""
XX. Validation
29. Validation

This is an experimental feature!

Each model instance has a validate() method that returns a dictionary of
validation errors in the instance's fields. This method has a side effect