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.
* 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>
* 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>
* 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>