Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6781 closed (worksforme)

ProgrammingError with edit_inline set

Reported by: imbaczek@… 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



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:
# snip my apps
# ...
Installed Middleware:

File "/home/imbaczek/usr/django-trunk/django/core/handlers/" in get_response
  82.                 response = callback(request, *callback_args, **callback_kwargs)
File "/home/imbaczek/usr/django-trunk/django/contrib/admin/views/" in _checklogin
  62.             return view_func(request, *args, **kwargs)
File "/home/imbaczek/usr/django-trunk/django/views/decorators/" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/home/imbaczek/usr/django-trunk/django/contrib/admin/views/" in change_stage
  338.             new_object =
File "/home/imbaczek/usr/django-trunk/django/db/models/" in save
File "/home/imbaczek/usr/django-trunk/django/db/models/" in save
  233.       'exact', pk_val))
File "/home/imbaczek/usr/django-trunk/django/db/backends/" 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

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)

edit_inline_too_many_lists.patch (1.6 KB) - added by imbaczek@… 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by imbaczek@…

comment:1 Changed 11 years ago by imbaczek@…

I think I managed to fix it myself. Please check.

comment:2 Changed 11 years ago by anonymous

Has patch: set
Summary: admin: ProgrammingError with edit_inline set[patch] admin: ProgrammingError with edit_inline set

comment:3 Changed 11 years ago by Malcolm Tredinnick

Summary: [patch] admin: ProgrammingError with edit_inline setProgrammingError 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 Changed 11 years ago by anonymous

Resolution: worksforme
Status: newclosed
Version: SVNnewforms-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.

comment:5 Changed 11 years ago by Honza Král

sorry, didn't mean to do that as Anonymous Coward

Note: See TracTickets for help on using tickets.
Back to Top