Django

Code

Changeset 3030

Show
Ignore:
Timestamp:
05/31/06 14:10:43 (2 years ago)
Author:
adrian
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/custom_methods/models.py

    r2809 r3030  
    11""" 
    2 3. Giving models custom methods and custom managers 
     23. Giving models custom methods 
    33 
    44Any method you add to a model will be available to instances. 
  • django/trunk/tests/modeltests/m2m_and_m2o/models.py

    r2809 r3030  
    11""" 
    2 27. Many-to-many and many-to-one relationships to the same table. 
     227. Many-to-many and many-to-one relationships to the same table 
    33 
    44This is a response to bug #1535 
     
    1717    def __repr__(self): 
    1818        return "<Issue %d>" % (self.num,) 
    19          
     19 
    2020    class Meta: 
    2121        ordering = ('num',) 
  • django/trunk/tests/modeltests/pagination/models.py

    r2809 r3030  
    11""" 
    2 20. Object Pagination 
     228. Object pagination 
    33 
    4 Django provides a framework for paginating a list of objects in a few.   
    5 This is often useful for dividing search results or long lists of objects 
    6 in to easily readable pages. 
     4Django provides a framework for paginating a list of objects in a few lines 
     5of code. This is often useful for dividing search results or long lists of 
     6objects into easily readable pages. 
     7""" 
    78 
    8  
    9 """ 
    109from django.db import models 
    1110 
     
    1312    headline = models.CharField(maxlength=100, default='Default headline') 
    1413    pub_date = models.DateTimeField() 
    15      
     14 
    1615    def __repr__(self): 
    17         return self.headline  
    18          
     16        return self.headline 
     17 
    1918API_TESTS = """ 
    2019# prepare a list of objects for pagination 
     
    35342 
    3635 
    37 # get the first page (zero-based)     
    38 >>> paginator.get_page(0)   
     36# get the first page (zero-based) 
     37>>> paginator.get_page(0) 
    3938[Article 1, Article 2, Article 3, Article 4, Article 5] 
    4039 
     
    4645>>> paginator.has_next_page(0) 
    4746True 
    48                                                  
     47 
    4948>>> paginator.has_previous_page(0) 
    5049False 
     
    5655>>> paginator.has_previous_page(1) 
    5756True 
    58   
     57 
    5958""" 
  • django/trunk/tests/modeltests/transactions/models.py

    r2809 r3030  
    11""" 
    2 XXX. Transactions 
     215. Transactions 
    33 
    44Django handles transactions in three different ways. The default is to commit 
  • django/trunk/tests/modeltests/validation/models.py

    r2809 r3030  
    11""" 
    2 XX. Validation 
     229. Validation 
     3 
     4This is an experimental feature! 
    35 
    46Each model instance has a validate() method that returns a dictionary of