summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-07-12 05:28:04 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-07-12 05:28:04 +0000
commitdcd5750d7ac6692428e431010772f1941406d576 (patch)
tree5fef412c418f0f557470217d263bc53b2063c068 /docs
parent06fc225ae6e00ed47f02eef7f6699e61cc76430e (diff)
Added RequestSite class to sites framework
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/sites.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/sites.txt b/docs/sites.txt
index 12259b04c3..e9982f745a 100644
--- a/docs/sites.txt
+++ b/docs/sites.txt
@@ -320,3 +320,21 @@ Here's how Django uses the sites framework:
.. _flatpages framework: ../flatpages/
.. _syndication framework: ../syndication/
.. _authentication framework: ../authentication/
+
+``RequestSite`` objects
+=======================
+
+**New in Django development version**
+
+Some ``django.contrib`` applications take advantage of the sites framework but
+are architected in a way that doesn't *require* the sites framework to be
+installed in your database. (Some people don't want to, or just aren't *able*
+to install the extra database table that the sites framework requires.) For
+those cases, the framework provides a ``RequestSite`` class, which can be used
+as a fallback when the database-backed sites framework is not available.
+
+A ``RequestSite`` object has a similar interface to a normal ``Site`` object,
+except its ``__init__()`` method takes an ``HttpRequest`` object. It's able to
+deduce the ``domain`` and ``name`` by looking at the request's domain. It has
+``save()`` and ``delete()`` methods to match the interface of ``Site``, but
+the methods raise ``NotImplementedError``.