AHhhhhhhhhhhh!
Thanks for the answer we found the problem!
No wonder no one but us had this problem, it was an old monkey-patch that
we did not even know it exists, that modified the behaviour of the queryset
Sorry for the trouble
Galia
On Tuesday, May 19, 2015 at 2:46:55 AM UTC+2, James Schneider wrote:
>
> My guess is a select_related('follow') call somewhere is causing the
> issue. The behavior for select_related() changed in 1.8.
>
> Can you post the entire trace back?
>
> -James
> On May 18, 2015 4:49 PM, "Galia Ladiray" <[email protected] <javascript:>>
> wrote:
>
>> Hi,
>> I wonder if anyone can help me, or just share the pain ...
>>
>> I have some code that goes like this (this is a very simplified version
>> of my code):
>> ---------------------------------------------------------------------
>> class Follower(models.Model):
>> follower = models.ForeignKey(MyUser, related_name='followed_by')
>> followed = models.ForeignKey(MyUser, related_name='follow')
>>
>> Class MyUser(models.Model):
>> .... some fields
>>
>> def get_followed(self, limit=16):
>> return MyUser.objects.filter(follow__follower__id=self.pk)
>> ---------------------------------------------------------------------
>>
>> This used to work fine, BUT after upgrade to django 1.8 I get an error
>> message:
>>
>> Cannot resolve keyword 'follow' into field. Choices are: (some fields and
>> ...), follow
>>
>> (which is a bit frustrating error message)
>>
>> I tried to recreate this on a new project (so I can post real code!) but
>> I cannot recreate the error, maybe something to do with the way tables were
>> names before and are named now on the DB?
>> I have a feeling it is something to do with the django 1.7 application
>> loader (regarding naming) but it used to work fine in 1.7
>>
>> Any ideas will be highly appreciated
>>
>> Thanks
>> Galia Ladiray-Weiss
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d58285fb-b7cd-40c7-9750-ee89b3bddc54%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/django-users/d58285fb-b7cd-40c7-9750-ee89b3bddc54%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/e3a764cd-4fe4-49cf-a206-ad31c3a75e3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.