Author: adrian Date: 2006-08-30 23:08:25 -0500 (Wed, 30 Aug 2006) New Revision: 3686
Modified: django/trunk/docs/sites.txt Log: Fixed #2609 -- Improved docs/sites.txt CurrentSiteManager to explain gotcha with models.Manager Modified: django/trunk/docs/sites.txt =================================================================== --- django/trunk/docs/sites.txt 2006-08-31 03:50:59 UTC (rev 3685) +++ django/trunk/docs/sites.txt 2006-08-31 04:08:25 UTC (rev 3686) @@ -266,7 +266,18 @@ If you attempt to use ``CurrentSiteManager`` and pass a field name that doesn't exist, Django will raise a ``ValueError``. +Finally, note that you'll probably want to keep a normal (non-site-specific) +``Manager`` on your model, even if you use ``CurrentSiteManager``. As explained +in the `manager documentation`_, if you define a manager manually, then Django +won't create the automatic ``objects = models.Manager()`` manager for you. +Also, note that certain parts of Django -- namely, the Django admin site and +generic views -- use whichever manager is defined *first* in the model, so if +you want your admin site to have access to all objects (not just site-specific +ones), put ``objects = models.Manager()`` in your model, before you define +``CurrentSiteManager``. + .. _manager: http://www.djangoproject.com/documentation/model_api/#managers +.. _manager documentation: http://www.djangoproject.com/documentation/model_api/#managers How Django uses the sites framework =================================== --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
