Index: docs/ref/contrib/sites.txt
===================================================================
--- docs/ref/contrib/sites.txt	(revision 17904)
+++ docs/ref/contrib/sites.txt	(working copy)
@@ -349,6 +349,26 @@
 If you attempt to use :class:`~django.contrib.sites.managers.CurrentSiteManager`
 and pass a field name that doesn't exist, Django will raise a ``ValueError``.
 
+.. versionchanged:: 1.5
+
+:class:`~django.contrib.sites.managers.CurrentSiteManager` can span
+multiple models by using the same syntax as queries, as per the
+:ref:`models and database queries documentation<field-lookups-intro>`. For
+example, using the ``Photo`` model defined above::
+
+    from django.db import models
+    from django.contrib.sites.managers import CurrentSiteManager
+
+    class PhotoLocation(models.Model):
+        name = models.CharField(max_length=100)
+        photo = models.ForeignKey(Photo)
+        objects = models.Manager()
+        on_site = CurrentSiteManager('photo__publish_on')
+
+``PhotoLocation.on_site.all()`` will return all ``PhotoLocation`` objects
+in the database associated with ``Photo`` objects which themselves are
+associated with the current site.
+
 Finally, note that you'll probably want to keep a normal
 (non-site-specific) ``Manager`` on your model, even if you use
 :class:`~django.contrib.sites.managers.CurrentSiteManager`. As
Index: django/contrib/sites/managers.py
===================================================================
--- django/contrib/sites/managers.py	(revision 17904)
+++ django/contrib/sites/managers.py	(working copy)
@@ -1,6 +1,7 @@
 from django.conf import settings
 from django.db import models
 from django.db.models.fields import FieldDoesNotExist
+from django.db.models.sql import constants
 
 class CurrentSiteManager(models.Manager):
     "Use this to limit objects to those associated with the current site."
@@ -10,31 +11,61 @@
         self.__is_validated = False
         
     def _validate_field_name(self):
-        field_names = self.model._meta.get_all_field_names()
-        
-        # If a custom name is provided, make sure the field exists on the model
-        if self.__field_name is not None and self.__field_name not in field_names:
-            raise ValueError("%s couldn't find a field named %s in %s." % \
-                (self.__class__.__name__, self.__field_name, self.model._meta.object_name))
-        
-        # Otherwise, see if there is a field called either 'site' or 'sites'
-        else:
+        """
+        Given the field identifier, goes down the chain to check that each
+        specified field
+
+            a) exists,
+            b) is of type ForeignKey or ManyToManyField
+
+        If no field name is specified when instantiating
+        CurrentSiteManager, it tries to find either 'site' or 'sites' as
+        the site link.
+        """
+        if self.__field_name is None:
+            # Guess at field name
+            field_names = self.model._meta.get_all_field_names()
             for potential_name in ['site', 'sites']:
                 if potential_name in field_names:
                     self.__field_name = potential_name
-                    self.__is_validated = True
                     break
-        
-        # Now do a type check on the field (FK or M2M only)
+            else:
+                raise ValueError(
+                    "%s couldn't find a field named either 'site' or 'sites' in %s." %
+                    (self.__class__.__name__, self.model._meta.object_name)
+                )
+
+        fieldname_chain = self.__field_name.split(constants.LOOKUP_SEP)
+        model = self.model
+
+        for fieldname in fieldname_chain:
+            # Throws an exception if anything goes bad
+            self._validate_single_field_name(model, fieldname)
+            model = self._get_related_model(model, fieldname)
+
+        # If we get this far without an exception, everything is good
+        self.__is_validated = True
+
+    def _validate_single_field_name(self, model, field_name):
+        """
+        Checks if the given field name can be used to make a link between a
+        model and a site with the CurrentSiteManager class
+        """
         try:
-            field = self.model._meta.get_field(self.__field_name)
+            field = model._meta.get_field(field_name)
             if not isinstance(field, (models.ForeignKey, models.ManyToManyField)):
-                raise TypeError("%s must be a ForeignKey or ManyToManyField." %self.__field_name)
+                raise TypeError("%s must be a ForeignKey or ManyToManyField." % field_name)
         except FieldDoesNotExist:
             raise ValueError("%s couldn't find a field named %s in %s." % \
-                    (self.__class__.__name__, self.__field_name, self.model._meta.object_name))
-        self.__is_validated = True
+                    (self.__class__.__name__, self.__field_name, model._meta.object_name))
     
+    def _get_related_model(self, model, fieldname):
+        """
+        Given a model and the name of a ForeignKey or ManyToManyField field
+        name as a string, returns the associated model.
+        """
+        return model._meta.get_field_by_name(fieldname)[0].rel.to
+
     def get_query_set(self):
         if not self.__is_validated:
             self._validate_field_name()
Index: tests/regressiontests/sites_framework/tests.py
===================================================================
--- tests/regressiontests/sites_framework/tests.py	(revision 17904)
+++ tests/regressiontests/sites_framework/tests.py	(working copy)
@@ -5,7 +5,7 @@
 from django.test import TestCase
 
 from .models import (SyndicatedArticle, ExclusiveArticle, CustomArticle,
-    InvalidArticle, ConfusedArticle)
+    InvalidArticle, ConfusedArticle, ArticleComment)
 
 
 class SitesFrameworkTestCase(TestCase):
@@ -36,3 +36,27 @@
     def test_invalid_field_type(self):
         article = ConfusedArticle.objects.create(title="More Bad News!", site=settings.SITE_ID)
         self.assertRaises(TypeError, ConfusedArticle.on_site.all)
+
+    def test_indirect_link(self):
+        article = ExclusiveArticle.objects.create(
+            title="Breaking News!",
+            site_id=settings.SITE_ID
+        )
+        article2 = ExclusiveArticle.objects.create(
+            title="More News!",
+            site_id=settings.SITE_ID + 1
+        )
+
+        comment = ArticleComment.objects.create(
+            parent_article=article,
+            text="First post!"
+        )
+        comment2 = ArticleComment.objects.create(
+            parent_article=article2,
+            text="Second post."
+        )
+
+        self.assertEqual(
+            ArticleComment.on_site.all().get(),
+            comment
+        )
Index: tests/regressiontests/sites_framework/models.py
===================================================================
--- tests/regressiontests/sites_framework/models.py	(revision 17904)
+++ tests/regressiontests/sites_framework/models.py	(working copy)
@@ -34,3 +34,10 @@
 
 class ConfusedArticle(AbstractArticle):
     site = models.IntegerField()
+
+class ArticleComment(models.Model):
+    parent_article = models.ForeignKey(ExclusiveArticle)
+    text = models.CharField(max_length=50)
+
+    objects = models.Manager()
+    on_site = CurrentSiteManager("parent_article__site")
