Django

Code

Changeset 3686

Show
Ignore:
Timestamp:
08/30/06 23:08:25 (2 years ago)
Author:
adrian
Message:

Fixed #2609 -- Improved docs/sites.txt CurrentSiteManager? to explain gotcha with models.Manager

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/sites.txt

    r2968 r3686  
    267267exist, Django will raise a ``ValueError``. 
    268268 
     269Finally, note that you'll probably want to keep a normal (non-site-specific) 
     270``Manager`` on your model, even if you use ``CurrentSiteManager``. As explained 
     271in the `manager documentation`_, if you define a manager manually, then Django 
     272won't create the automatic ``objects = models.Manager()`` manager for you. 
     273Also, note that certain parts of Django -- namely, the Django admin site and 
     274generic views -- use whichever manager is defined *first* in the model, so if 
     275you want your admin site to have access to all objects (not just site-specific 
     276ones), put ``objects = models.Manager()`` in your model, before you define 
     277``CurrentSiteManager``. 
     278 
    269279.. _manager: http://www.djangoproject.com/documentation/model_api/#managers 
     280.. _manager documentation: http://www.djangoproject.com/documentation/model_api/#managers 
    270281 
    271282How Django uses the sites framework