Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2609 -- Improved docs/sites.txt CurrentSiteManager to explain …

…gotcha with models.Manager

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3686 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 452847a6591596313b29b8cf290216047980ea30 1 parent 5e69536
Adrian Holovaty authored August 31, 2006

Showing 1 changed file with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  docs/sites.txt
11  docs/sites.txt
@@ -266,7 +266,18 @@ this::
266 266
 If you attempt to use ``CurrentSiteManager`` and pass a field name that doesn't
267 267
 exist, Django will raise a ``ValueError``.
268 268
 
  269
+Finally, 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
  271
+in the `manager documentation`_, if you define a manager manually, then Django
  272
+won't create the automatic ``objects = models.Manager()`` manager for you.
  273
+Also, note that certain parts of Django -- namely, the Django admin site and
  274
+generic views -- use whichever manager is defined *first* in the model, so if
  275
+you want your admin site to have access to all objects (not just site-specific
  276
+ones), put ``objects = models.Manager()`` in your model, before you define
  277
+``CurrentSiteManager``.
  278
+
269 279
 .. _manager: http://www.djangoproject.com/documentation/model_api/#managers
  280
+.. _manager documentation: http://www.djangoproject.com/documentation/model_api/#managers
270 281
 
271 282
 How Django uses the sites framework
272 283
 ===================================

0 notes on commit 452847a

Please sign in to comment.
Something went wrong with that request. Please try again.