[Django] #22249: Cannot resolve keyword '' into field. Choices are:...

972 views
Skip to first unread message

Django

unread,
Mar 11, 2014, 1:40:57 PM3/11/14
to django-...@googlegroups.com
#22249: Cannot resolve keyword '' into field. Choices are:...
------------------------------+--------------------
Reporter: srnsht@… | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------
I am having this weird problem accessing ManyToManyField.

I have following models.

class Link(models.Model):
title = models.CharField(max_length = 200)
url = models.URLField(unique = True)
tags = models.ManyToManyField(Tag)
creation_date = models.DateTimeField(auto_now_add = True)
user = models.ForeignKey(User)
likes = models.ManyToManyField(User, related_name =
"%(app_label)s_%(class)s_user_likes")
dis_likes = models.ManyToManyField(User, related_name =
"%(app_label)s_%(class)s_user_dis_likes")

class Meta:
abstract = True

class URL(Link):
preview_image = models.URLField()
preview_heading = models.CharField(max_length = 100)
preview_content = models.CharField(max_length = 100)

When I try to access URL.objects.get(pk=1).likes.all(), I get Cannot
resolve keyword '' into field. Choices are:... error.

URL.objects.get(pk=1).tags.all(), URL.objects.get(pk=1).user and
URL.objects.filter(likes=auser, pk=1) work fine.

Updates:

The fields likes and dis_likes were added using south through
schemamigration
Previously I was using Django 1.6.1, updated to Django 1.6.2, the problem
still persists
Truncated the database, synced it to have fresh tables, the problem still
persists

--
Ticket URL: <https://code.djangoproject.com/ticket/22249>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 11, 2014, 11:27:28 PM3/11/14
to django-...@googlegroups.com
#22249: Cannot resolve keyword '' into field. Choices are:...
------------------------------+--------------------------------------
Reporter: srnsht@… | Owner: nobody
Type: Bug | Status: closed
Component: contrib.auth | Version: 1.6
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by anonymous):

* status: new => closed
* needs_better_patch: => 0
* resolution: => fixed
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/22249#comment:1>

Django

unread,
Mar 12, 2014, 5:08:59 AM3/12/14
to django-...@googlegroups.com
#22249: Cannot resolve keyword '' into field. Choices are:...
------------------------------+--------------------------------------

Reporter: srnsht@… | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 1.6
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by mjtamlyn):

* status: closed => new
* resolution: fixed =>


Comment:

Doesn't look like this has been fixed? I haven't verified the OP's comment
is a real problem though.

--
Ticket URL: <https://code.djangoproject.com/ticket/22249#comment:2>

Django

unread,
Mar 20, 2014, 11:06:45 AM3/20/14
to django-...@googlegroups.com
#22249: Cannot resolve keyword '' into field. Choices are:...
------------------------------+--------------------------------------
Reporter: srnsht@… | Owner: nobody
Type: Bug | Status: closed
Component: contrib.auth | Version: 1.6
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by bmispelon):

* status: new => closed

* resolution: => worksforme


Comment:

Hi,

Using the provided models (I also defined an empty `Tag` model and I
assumed `User` referred to `auth.User`), I cannot reproduce the issue.

I tried both on master and on 1.6.

Could you provide more information on how you're able to trigger this
error?
Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/22249#comment:3>

Reply all
Reply to author
Forward
0 new messages