diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-05-22 05:22:58 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-05-22 05:22:58 +0000 |
| commit | e3ac3bc074b0fe56af856adb41d8220cfe376fbb (patch) | |
| tree | 1437160e58de6ba6e879e1396422e6b04be3e0d4 | |
| parent | 610cffe80e1d6e1f603ce50d248de22c41c871fa (diff) | |
Added small bit to docs/sites.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2963 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/sites.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/sites.txt b/docs/sites.txt index 153b0141c5..b78cd84d05 100644 --- a/docs/sites.txt +++ b/docs/sites.txt @@ -239,6 +239,11 @@ With this model, ``Photo.objects.all()`` will return all ``Photo`` objects in the database, but ``Photo.on_site.all()`` will return only the ``Photo`` objects associated with the current site, according to the ``SITE_ID`` setting. +Put another way, these two statements are equivalent:: + + Photo.objects.filter(site=settings.SITE_ID) + Photo.on_site.all() + How did ``CurrentSiteManager`` know which field of ``Photo`` was the ``Site``? It defaults to looking for a field called ``site``. If your model has a ``ForeignKey`` or ``ManyToManyField`` called something *other* than ``site``, |
