Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added django.contrib.sites.managers, which contains CurrentSiteManage…

…r. Thanks, Ian Holsman

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2959 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a9039dc6b3a01f9af225f699a7da930d99ecdcea 1 parent e3839f3
Adrian Holovaty authored May 22, 2006

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

  1. 11  django/contrib/sites/managers.py
11  django/contrib/sites/managers.py
... ...
@@ -0,0 +1,11 @@
  1
+from django.db import models
  2
+from django.conf import settings
  3
+
  4
+class CurrentSiteManager(models.Manager):
  5
+    "Use this to limit objects to those associated with the current site."
  6
+    def __init__(self, field_name='site')
  7
+        super(SiteLimitManager, self).__init__()
  8
+        self.__lookup = field_name + '__id__exact'
  9
+
  10
+    def get_query_set(self):
  11
+        return super(SiteLimitManager, self).get_query_set().filter(self.__lookup=settings.SITE_ID)

0 notes on commit a9039dc

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