title: Why does prefetch_related() raise AttributeError?
body: <p>I have a model with a many-to-many relationship with a second model.  When I try to use prefetch_related I get an AttributeError.  The models could be summarised as:</p>
  
  <pre><code>class AcademicSubject(TranslatableModel):
      translations = TranslatedFields(
          name = CharField(max_length=255)
      )
  
  class UserProfile(Model):
      user = OneToOneField(settings.AUTH_USER_MODEL)
      # ... other fields
      subjects = ManyToManyField(AcademicSubject, blank=True)
  </code></pre>
  
  <p>(Various details omitted).  The <code>TranslatableModel</code> and <code>TranslatedFields</code> are from <a href="https://django-hvad.readthedocs.org/en/latest/" rel="nofollow">django-hvad</a>, and while I don't believe they are important in this case I'm not 100% sure so I thought I'd include that.</p>
  
  <p>The queryset I'm trying to iterate through is:</p>
  
  <pre><code>UserProfile.objects.all().select_related('user').prefetch_related('subjects')
  </code></pre>
  
  <p>The stacktrace I get is:</p>
  
  <pre><code>Traceback:
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
    111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
    105.                     response = view_func(request, *args, **kwargs)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
    52.         response = view_func(request, *args, **kwargs)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
    206.             return view(request, *args, **kwargs)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/views/generic/base.py" in view
    69.             return self.dispatch(request, *args, **kwargs)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
    87.         return handler(request, *args, **kwargs)
  File "/home/hamish/dev/django/website/mentor_reports/views.py" in get
    45.         for item in self.get_queryset():
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/query.py" in __iter__
    141.         self._fetch_all()
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all
    968.             self._prefetch_related_objects()
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/query.py" in _prefetch_related_objects
    611.         prefetch_related_objects(self._result_cache, self._prefetch_related_lookups)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/query.py" in prefetch_related_objects
    1791.                 obj_list, additional_lookups = prefetch_one_level(obj_list, prefetcher, lookup, level)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/query.py" in prefetch_one_level
    1906.         rel_attr_val = rel_obj_attr(rel_obj)
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in &lt;lambda&gt;
    912.                     lambda result: tuple(getattr(result, '_prefetch_related_val_%s' % f.attname) for f in fk.local_related_fields),
  File "/home/hamish/dev/django/website/.ve/local/lib/python2.7/site-packages/django/db/models/fields/related.py" in &lt;genexpr&gt;
    912.                     lambda result: tuple(getattr(result, '_prefetch_related_val_%s' % f.attname) for f in fk.local_related_fields),
  
  Exception Type: AttributeError at /en/admin/user_report
  Exception Value: 'AcademicSubject' object has no attribute '_prefetch_related_val_userprofile_id'
  </code></pre>
  
  <p>I am using Django 1.7</p>
  
  <p>Is there anything in how I've set it up that looks wrong?</p>