﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6781	ProgrammingError with edit_inline set	imbaczek@…	nobody	"{{{
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."		closed	contrib.admin	newforms-admin		worksforme			Unreviewed	1	0	0	0	0	0
