title: Django ORM cannot resolve keyword for related field for aggregate when model used by more than one application
body: <p>In Django 1.5 I have 3 apps: common, app1, app2 in which I have the following (simplified) models:</p>
  
  <pre><code># common/models.py
  class ApiUser(models.Model):
      username = models.CharField(max_length=255)
      channel = models.CharField(max_length=20)
  
  # app1/models.py
  class Place(models.Model):
      title = models.CharField(max_length=255)
      created_by = models.ForeignKey('common.ApiUser', null=True, related_name="%(app_label)s_places")
  
  # app2/models.py
  class Tag(models.Model):
      name = models.CharField(max_length=255)
      user = models.ForeignKey('common.ApiUser', null=True, related_name="%(app_label)s_tags")
  </code></pre>
  
  <p><code>app1</code> is listed before <code>app2</code> in <code>INSTALLED_APPS</code>.</p>
  
  <p>When I try to create the following queryset:</p>
  
  <pre><code>qs = ApiUser.objects.filter(channel='app1').annotate(Count('app1_places'))
  </code></pre>
  
  <p>I get back:</p>
  
  <pre><code>Cannot resolve keyword 'app1_places' into field. Choices are: app2_tags, channel, username
  </code></pre>
  
  <p>Where the list of choices provided does not include <code>'app1_places'</code> but does contain <code>'app2_tags'</code>. However if I try to reference <code>app1_places</code> on a model instance I don't get an error; it works fine:</p>
  
  <pre><code>&gt;&gt;&gt; u = ApiUser.objects.get(pk=23)
  &gt;&gt;&gt; u.app1_places.all()
  []
  </code></pre>
  
  <p>Annotate with <code>app2_tags</code> works too:</p>
  
  <pre><code>qs = ApiUser.objects.filter(channel='app2').annotate(Count('app2_tags'))
  </code></pre>
  
  <p>Is this a bug in django or is there something I am doing wrong configuring these fields.</p>
  
  <p><strong>edit</strong>: here is the stack trace:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "/home/vagrant/.virtualenvs/thorium/lib/python2.6/site-packages/django/db/models/query.py", line 795, in annotate
      is_summary=False)
    File "/home/vagrant/.virtualenvs/thorium/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1019, in add_aggregate
  field_list, opts, self.get_initial_alias(), False)
    File "/home/vagrant/.virtualenvs/thorium/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1337, in setup_joins
    "Choices are: %s" % (name, ", ".join(names)))
  FieldError: Cannot resolve keyword 'app1_places' into field. Choices are: app2_tags, channel, username
  </code></pre>
  
  <p><strong>Note:</strong> some app1 models are using the GeoDjango GeoManager (including places) but there are also models in app1 which don't use the geomanager and have foreign keys that also do not work with annotate.</p>