<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -51,7 +51,11 @@ HttpResponse objects and:
     userskins cookie. When it does hit the database, it will
     set a cookie for the user, so it should only be necessary
     to hit the database once each time a user cleans their
-    cookie cache.)
+    cookie cache. Also note, that you may use the
+    ``USERSKINS_NEVER_ACCESS_DATABASE`` setting value to
+    disable the middleware, and thus remove all database
+    accesses, although skin preferences will no longer
+    persist across cookie cleanings.)
 
     Set the value of the ``userskins`` cookie to the value stored
     in the ``SkinPreference`` object if one exists, otherwise set
@@ -107,20 +111,34 @@ django-compress group.
             'light':'light.css',
             'dark':'dark.css',
         }
-        USERSKINS_USE_COMPRESS_GROUPS = False
+        USERSKINS_USE_COMPRESS_GROUPS = False   # optional
+        USERSKINS_NEVER_ACCESS_DATABASE = False # optional
 
     ``USERSKINS_USE_COMPRESS_GROUPS`` is to support integration
     with the django-compress project. In that case, the values of keys
     in ``USERSKINS_DETAILS`` are ignored, and the keys themselves are
     passed to the django-compress template tags as names of compressed
-    css groups.
+    css groups. The default value of ``USERSKINS_USER_COMPRESS_GROUP``
+    is False.
 
     It is highly recommended to use django-userskins along with
     django-compress, as it will allow you to provide users with
     selectable skins without increasing the median bandwith per
     request or the median number of http requests per page.
 
-6.  Now modify your base template (or wherever you want to use skins)
+    There is also the ``USERSKINS_NEVER_ACCESS_DATABASE`` option,
+    which is what you should use if you want skin preferences to
+    be entirely cookie based (and never check the database if
+    the user has an associated SkinPreference object). The default
+    value of ``USERSKINS_NEVER_ACCESS_DATABASE`` is False.
+
+7.  Sync your database to create the relevant models.
+    Note that this is not necessary if you use
+    ``USERSKINS_NEVER_ACCESS_DATABASE = True``.
+
+        python manage.py syncdb
+
+8.  Now modify your base template (or wherever you want to use skins)
     to resemble this code:
 
         {% load userskins %}
@@ -133,5 +151,12 @@ django-compress group.
         &lt;/body&gt;
         &lt;/html&gt;
 
-    And you're done.
+9.  The last stage of setup is to setup a mechanism for
+    allowing users to select skins. Depending on your needs,
+    this may be as simple as a view that sets an appropriate
+    cookie and redirects to the page they came from, or it may
+    be part of a user preferences panel.
 
+    More details coming soon, for the time being look at the
+    userskins.models.SkinPreference model and the
+    dev_userskins.urls file for some ideas.
\ No newline at end of file</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,5 @@
     the response, and b) create a SkinPreference instance
     for the user and skin.
 
-3.  Add an option to disable hitting the database if
-    a user is missing the cookie. (Only use cookies for
-    skin preference persistence.)
-
-4.  Test that the integration with django-compress
+2.  Test that the integration with django-compress
     actually works (pretty sure it does ;).
\ No newline at end of file</diff>
      <filename>TODO.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,8 @@ USERSKINS_DETAILS = {
     'light':'light.css',
     'dark':'dark.css',
 }
-USERSKINS_USE_COMPRESS_GROUPS = False
+USERSKINS_USE_COMPRESS_GROUPS = False   # optional, defaults to False
+USERSKINS_NEVER_ACCESS_DATABASE = False  # optional, defaults to False
 
 TEMPLATE_CONTEXT_PROCESSORS = (
     &quot;django.core.context_processors.auth&quot;,</diff>
      <filename>dev_userskins/settings.py</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ def userskins(request):
     skin = settings.USERSKINS_DEFAULT
     if request.COOKIES.has_key(&quot;userskins&quot;):
         skin = request.COOKIES[&quot;userskins&quot;]
-    if settings.USERSKINS_USE_COMPRESS_GROUPS:
+    if getattr(settings,&quot;USERSKINS_USE_COMPRESS_GROUPS&quot;,False):
         return {&quot;userskins_skin&quot;: skin, &quot;userskins_use_compress&quot;:True }
     else:
         skin_uri = u&quot;%s%s&quot; % (settings.MEDIA_URL, settings.USERSKINS_DETAILS[skin])</diff>
      <filename>userskins/context.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,15 @@
 from django.conf import settings
 from userskins.models import SkinPreference
-
+import django
 
 class UserskinsMiddleware(object):
+    def __init__(self):
+        never_use_database = getattr(settings,&quot;USERSKINS_NEVER_ACCESS_DATABASE&quot;, False)
+        if never_use_database:
+            raise django.core.exceptions.MiddlewareNotUsed
+
     def process_response(self, request, response):
+        print &quot;wee&quot;
         if not request.COOKIES.has_key(&quot;userskins&quot;):
             skin = settings.USERSKINS_DEFAULT
             if request.user.is_authenticated():</diff>
      <filename>userskins/middleware.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>14ec608e8746ce38e18e07dfe260c211bfc2024b</id>
    </parent>
  </parents>
  <author>
    <name>Will Larson</name>
    <email>lethain@gmail.com</email>
  </author>
  <url>http://github.com/lethain/django-userskins/commit/a7108658daaec805f83e59ea8fd57459f77d835f</url>
  <id>a7108658daaec805f83e59ea8fd57459f77d835f</id>
  <committed-date>2008-10-27T07:55:46-07:00</committed-date>
  <authored-date>2008-10-27T07:55:46-07:00</authored-date>
  <message>Added support for the USERSKINS_NEVER_ACCESS_DATABASE setting, which uses only cookies for skin preference persistence, and will never hit the database to check if the user has an associated SkinPreference value.</message>
  <tree>ab351f7b49fbd612620935f4014c2f767c0a759b</tree>
  <committer>
    <name>Will Larson</name>
    <email>lethain@gmail.com</email>
  </committer>
</commit>
