Author: adrian
Date: 2006-05-31 13:45:17 -0500 (Wed, 31 May 2006)
New Revision: 3028

Modified:
   django/trunk/tests/modeltests/custom_managers/models.py
   django/trunk/tests/modeltests/invalid_models/models.py
   django/trunk/tests/modeltests/manipulators/models.py
   django/trunk/tests/modeltests/model_inheritance/models.py
   django/trunk/tests/modeltests/properties/models.py
Log:
Added blurbs to the model unit tests that didn't have them

Modified: django/trunk/tests/modeltests/custom_managers/models.py
===================================================================
--- django/trunk/tests/modeltests/custom_managers/models.py     2006-05-31 
18:44:14 UTC (rev 3027)
+++ django/trunk/tests/modeltests/custom_managers/models.py     2006-05-31 
18:45:17 UTC (rev 3028)
@@ -1,5 +1,12 @@
 """
 23. Giving models a custom manager
+
+You can use a custom ``Manager`` in a particular model by extending the base
+``Manager`` class and instantiating your custom ``Manager`` in your model.
+
+There are two reasons you might want to customize a ``Manager``: to add extra
+``Manager`` methods, and/or to modify the initial ``QuerySet`` the ``Manager``
+returns.
 """
 
 from django.db import models
@@ -19,7 +26,7 @@
     def __repr__(self):
         return "%s %s" % (self.first_name, self.last_name)
 
-# An example of a custom manager that sets a core_filter on its lookups.
+# An example of a custom manager that sets get_query_set().
 
 class PublishedBookManager(models.Manager):
     def get_query_set(self):

Modified: django/trunk/tests/modeltests/invalid_models/models.py
===================================================================
--- django/trunk/tests/modeltests/invalid_models/models.py      2006-05-31 
18:44:14 UTC (rev 3027)
+++ django/trunk/tests/modeltests/invalid_models/models.py      2006-05-31 
18:45:17 UTC (rev 3028)
@@ -1,5 +1,7 @@
 """
-26. A test to check that the model validator works can correctly identify 
errors in a model. 
+26. Invalid models
+
+This example exists purely to point out errors in models.
 """
 
 from django.db import models
@@ -11,16 +13,16 @@
     prepopulate = models.CharField(maxlength=10, prepopulate_from='bad')
     choices = models.CharField(maxlength=10, choices='bad')
     choices2 = models.CharField(maxlength=10, choices=[(1,2,3),(1,2,3)])
-    index = models.CharField(maxlength=10, db_index='bad')    
+    index = models.CharField(maxlength=10, db_index='bad')
 
 class Target(models.Model):
     tgt_safe = models.CharField(maxlength=10)
-    
+
     clash1_set = models.CharField(maxlength=10)
-    
+
 class Clash1(models.Model):
     src_safe = models.CharField(maxlength=10)
-    
+
     foreign = models.ForeignKey(Target)
     m2m = models.ManyToManyField(Target)
 
@@ -36,27 +38,27 @@
 class Target2(models.Model):
     foreign_tgt = models.ForeignKey(Target)
     clashforeign_set = models.ForeignKey(Target)
-    
+
     m2m_tgt = models.ManyToManyField(Target)
     clashm2m_set = models.ManyToManyField(Target)
 
 class Clash3(models.Model):
     foreign_1 = models.ForeignKey(Target2, related_name='foreign_tgt')
     foreign_2 = models.ForeignKey(Target2, related_name='m2m_tgt')
-    
+
     m2m_1 = models.ManyToManyField(Target2, related_name='foreign_tgt')
     m2m_2 = models.ManyToManyField(Target2, related_name='m2m_tgt')
-    
+
 class ClashForeign(models.Model):
     foreign = models.ForeignKey(Target2)
 
 class ClashM2M(models.Model):
     m2m = models.ManyToManyField(Target2)
-    
+
 class SelfClashForeign(models.Model):
     src_safe = models.CharField(maxlength=10)
-    
-    selfclashforeign_set = models.ForeignKey("SelfClashForeign") 
+
+    selfclashforeign_set = models.ForeignKey("SelfClashForeign")
     foreign_1 = models.ForeignKey("SelfClashForeign", related_name='id')
     foreign_2 = models.ForeignKey("SelfClashForeign", related_name='src_safe')
 

Modified: django/trunk/tests/modeltests/manipulators/models.py
===================================================================
--- django/trunk/tests/modeltests/manipulators/models.py        2006-05-31 
18:44:14 UTC (rev 3027)
+++ django/trunk/tests/modeltests/manipulators/models.py        2006-05-31 
18:45:17 UTC (rev 3028)
@@ -1,5 +1,7 @@
 """
 25. Default manipulators
+
+Each model gets an AddManipulator and ChangeManipulator by default.
 """
 
 from django.db import models

Modified: django/trunk/tests/modeltests/model_inheritance/models.py
===================================================================
--- django/trunk/tests/modeltests/model_inheritance/models.py   2006-05-31 
18:44:14 UTC (rev 3027)
+++ django/trunk/tests/modeltests/model_inheritance/models.py   2006-05-31 
18:45:17 UTC (rev 3028)
@@ -1,6 +1,7 @@
 """
 XX. Model inheritance
 
+Model inheritance isn't yet supported.
 """
 
 from django.db import models

Modified: django/trunk/tests/modeltests/properties/models.py
===================================================================
--- django/trunk/tests/modeltests/properties/models.py  2006-05-31 18:44:14 UTC 
(rev 3027)
+++ django/trunk/tests/modeltests/properties/models.py  2006-05-31 18:45:17 UTC 
(rev 3028)
@@ -1,5 +1,7 @@
 """
 22. Using properties on models
+
+Use properties on models just like on any other Python object.
 """
 
 from django.db import models


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---

Reply via email to