Django.core.exceptions. Field Error Cannot Resolve Keyword
Contents |
here for a quick overview of the site Help Center Detailed cannot resolve keyword into field answers to any questions you might have Meta Discuss
Cannot Resolve Keyword 'user' Into Field
the workings and policies of this site About Us Learn more about Stack Overflow the
Cannot Resolve Keyword 'id' Into Field
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Cannot Resolve Keyword 'slug' Into Field. Choices Are:
Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Django 1.8 - FieldError: Cannot resolve keyword into field up vote 4 down vote favorite 1 I recently upgraded from cannot resolve keyword name into field Django 1.6 to Django 1.8. When I did, I found that I was no longer able to to do a lookup back through a foreign key relationship as described in: https://docs.djangoproject.com/en/1.8/topics/db/queries/#lookups-that-span-relationships. The system is set up so that there are two projects which use the same database. (Not my idea, but not something I would like to change right now.) The project where the models were initially created and migrated works just fine after the upgrade, but the other one does not. The models file for each is identical. Models.py: class Site(models.Model): name = models.CharField(max_length=255) class Meta: app_label = 'project1' class Page(models.Model): title = models.CharField(max_length=255) site = models.ForeignKey('Site') class Meta: app_label = 'project1' Error traceback from the Django Shell: >>> x = models.Site.objects.filter(page__id=1000) Traceback (most recent call last): File "
here for a quick overview of the site Help django fielderror cannot resolve keyword Center Detailed answers to any questions you might have related field got invalid lookup: icontains Meta Discuss the workings and policies of this site About Us Learn more about Stack django related_name Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask http://stackoverflow.com/questions/31864885/django-1-8-fielderror-cannot-resolve-keyword-into-field Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Django: FieldError cannot resolve keyword '___' into a field up vote 0 down vote favorite http://stackoverflow.com/questions/4702402/django-fielderror-cannot-resolve-keyword-into-a-field I'm having a FieldError. I have a model: class Foo(models.Model): __bar = models.TextField(default=lambda: cPickle.dumps(set()), primary_key=True) def get_bar(self): return cPickle.loads(str(self.__bar)) def set_bar(self, values): self.__bar = cPickle.dumps(values) bar = property(get_bar, set_bar) I have registered it with the admin in admin.py: admin.site.register(Foo) When I runserver and go to /admin, I see Foo in the list. If I click "Add", it works fine, showing the form to add a new Foo. However, if I click "save and add another" or "change" or "Foos", I get a FieldError FieldError at /admin/appname/Foo/ Cannot resolve keyword '_Foo' into field. Choices are: _Foo__bar, appname The traceback is: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/appname/foo/ Django Version: 1.2.4 Python Version: 2.6.6 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', 'pagination', 'apps.appname'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'pagination.middleware.PaginationMiddleware') Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response 100. response = callback(request, *callb
Previous TicketNext Ticket → Opened 3 years ago Closed 3 years https://code.djangoproject.com/ticket/22047 ago Last modified 3 years ago #22047 closed Bug (fixed) Cannot resolve keyword u'group_ptr' into field. Choices are: group, id, name, permissions, user Reported by: Chris Chan Owned by: Konrad Świat Component: Database layer (models, cannot resolve ORM) Version: 1.6 Severity: Normal Keywords: Cc: Triage Stage: Ready for checkin Has patch: yes Needs documentation: no Needs tests: no Patch needs improvement: no Easy pickings: no UI/UX: no Description I recently tried to upgrade cannot resolve keyword from 1.5.1 to 1.6.2 and am now getting this error for inherited many to many relationships. Traceback (most recent call last): File "