Django

Code

Changeset 3028

Show
Ignore:
Timestamp:
05/31/06 13:45:17 (2 years ago)
Author:
adrian
Message:

Added blurbs to the model unit tests that didn't have them

Files:

Legend:

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

    r2809 r3028  
    11""" 
    2223. Giving models a custom manager 
     3 
     4You can use a custom ``Manager`` in a particular model by extending the base 
     5``Manager`` class and instantiating your custom ``Manager`` in your model. 
     6 
     7There are two reasons you might want to customize a ``Manager``: to add extra 
     8``Manager`` methods, and/or to modify the initial ``QuerySet`` the ``Manager`` 
     9returns. 
    310""" 
    411 
     
    2027        return "%s %s" % (self.first_name, self.last_name) 
    2128 
    22 # An example of a custom manager that sets a core_filter on its lookups
     29# An example of a custom manager that sets get_query_set()
    2330 
    2431class PublishedBookManager(models.Manager): 
  • django/trunk/tests/modeltests/invalid_models/models.py

    r2809 r3028  
    11""" 
    2 26. A test to check that the model validator works can correctly identify errors in a model.  
     226. Invalid models 
     3 
     4This example exists purely to point out errors in models. 
    35""" 
    46 
     
    1214    choices = models.CharField(maxlength=10, choices='bad') 
    1315    choices2 = models.CharField(maxlength=10, choices=[(1,2,3),(1,2,3)]) 
    14     index = models.CharField(maxlength=10, db_index='bad')     
     16    index = models.CharField(maxlength=10, db_index='bad') 
    1517 
    1618class Target(models.Model): 
    1719    tgt_safe = models.CharField(maxlength=10) 
    18      
     20 
    1921    clash1_set = models.CharField(maxlength=10) 
    20      
     22 
    2123class Clash1(models.Model): 
    2224    src_safe = models.CharField(maxlength=10) 
    23      
     25 
    2426    foreign = models.ForeignKey(Target) 
    2527    m2m = models.ManyToManyField(Target) 
     
    3739    foreign_tgt = models.ForeignKey(Target) 
    3840    clashforeign_set = models.ForeignKey(Target) 
    39      
     41 
    4042    m2m_tgt = models.ManyToManyField(Target) 
    4143    clashm2m_set = models.ManyToManyField(Target) 
     
    4446    foreign_1 = models.ForeignKey(Target2, related_name='foreign_tgt') 
    4547    foreign_2 = models.ForeignKey(Target2, related_name='m2m_tgt') 
    46      
     48 
    4749    m2m_1 = models.ManyToManyField(Target2, related_name='foreign_tgt') 
    4850    m2m_2 = models.ManyToManyField(Target2, related_name='m2m_tgt') 
    49      
     51 
    5052class ClashForeign(models.Model): 
    5153    foreign = models.ForeignKey(Target2) 
     
    5355class ClashM2M(models.Model): 
    5456    m2m = models.ManyToManyField(Target2) 
    55      
     57 
    5658class SelfClashForeign(models.Model): 
    5759    src_safe = models.CharField(maxlength=10) 
    58      
    59     selfclashforeign_set = models.ForeignKey("SelfClashForeign")  
     60 
     61    selfclashforeign_set = models.ForeignKey("SelfClashForeign") 
    6062    foreign_1 = models.ForeignKey("SelfClashForeign", related_name='id') 
    6163    foreign_2 = models.ForeignKey("SelfClashForeign", related_name='src_safe') 
  • django/trunk/tests/modeltests/manipulators/models.py

    r2809 r3028  
    11""" 
    2225. Default manipulators 
     3 
     4Each model gets an AddManipulator and ChangeManipulator by default. 
    35""" 
    46 
  • django/trunk/tests/modeltests/model_inheritance/models.py

    r2809 r3028  
    22XX. Model inheritance 
    33 
     4Model inheritance isn't yet supported. 
    45""" 
    56 
  • django/trunk/tests/modeltests/properties/models.py

    r2809 r3028  
    11""" 
    2222. Using properties on models 
     3 
     4Use properties on models just like on any other Python object. 
    35""" 
    46