#6781 closed (worksforme)
ProgrammingError with edit_inline set
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Environment: Request Method: POST Request URL: http://debian:8000/admin/businessPartner/entry/33/ Django Version: 0.97-pre-SVN-7249 Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', # snip my apps # ... 'registration', 'template_utils', 'nesh.thumbnail'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware') Traceback: File "/home/imbaczek/usr/django-trunk/django/core/handlers/base.py" in get_response 82. response = callback(request, *callback_args, **callback_kwargs) File "/home/imbaczek/usr/django-trunk/django/contrib/admin/views/decorators.py" in _checklogin 62. return view_func(request, *args, **kwargs) File "/home/imbaczek/usr/django-trunk/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/home/imbaczek/usr/django-trunk/django/contrib/admin/views/main.py" in change_stage 338. new_object = manipulator.save(new_data) File "/home/imbaczek/usr/django-trunk/django/db/models/manipulators.py" in save 201. new_rel_obj.save() File "/home/imbaczek/usr/django-trunk/django/db/models/base.py" in save 233. self._meta.pk.get_db_prep_lookup('exact', pk_val)) File "/home/imbaczek/usr/django-trunk/django/db/backends/util.py" in execute 18. return self.cursor.execute(sql, params) Exception Type: ProgrammingError at /admin/businessPartner/entry/33/ Exception Value: operator does not exist: integer = text[] LINE 1: SELECT 1 FROM "table" WHERE "id"=ARRAY['34... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
I added some print statements near the offending cursor.execute and for get_db_prep_lookup (note: expect line mismatch in traceback), here are the results:
exact pk= [u'33'] exact pk= [[u'34']] sql=SELECT 1 FROM "table" WHERE "id"=%s params=[[u'34']]
clearly the found pk is being put on a list that breaks stuff. The models don't use any custom fields. The SELECT statement refers to the first of inline-edited objects.
SVN r7249.
Attachments (1)
Change History (6)
by , 17 years ago
Attachment: | edit_inline_too_many_lists.patch added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Has patch: | set |
---|---|
Summary: | admin: ProgrammingError with edit_inline set → [patch] admin: ProgrammingError with edit_inline set |
comment:3 by , 17 years ago
Summary: | [patch] admin: ProgrammingError with edit_inline set → ProgrammingError with edit_inline set |
---|
It's impossible to evaluate this fix without having some way to repeat the problem. Since edit_inline isn't completely broken, there must be something about your particular case that is special. Please construct a very short example pair of models and describe how to replicate the problem.
comment:4 by , 17 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Version: | SVN → newforms-admin |
Closing this ticket since its deprecated with newforms-admin. If it doesn't work there as well, feel free to open a new one.
I think I managed to fix it myself. Please check.