﻿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
12907	Problems with django admin on Jython with custom user models	gbauer	nobody	"It looks like django passes the unparsed string parameter from the URL to the sql method that fetches the custom user instance from the database when you edit a custom user in the django admin. The result on Jython is that due to the different backend, the database complains that it can't compare integers and varchars.

/home/gb/Projects/JythonPlay/Lib/site-packages/doj/backends/zxjdbc/common.py in execute
        self.cursor.execute(sql, params) ...
Local vars

params (u'4',)
self <doj.backends.zxjdbc.postgresql.base.CursorWrapper object at 0x4af>

sql	
'SELECT ""auth_group"".""id"", ""auth_group"".""name"", ""Organisation_rolle"".""group_ptr_id"", ""Organisation_rolle"".""kurz_name"" FROM ""Organisation_rolle"" INNER JOIN ""auth_group"" ON (""Organisation_rolle"".""group_ptr_id"" = ""auth_group"".""id"") WHERE ""Organisation_rolle"".""group_ptr_id"" = ? '

I am currently not sure wether this is a problem of the backend or the admin, but for some reason I think the admin could be to be blamed - an sql command shouldn't get wrong types for parameters. Allthough it could be a result of the %s vs ? handling of parameters - the JDBC backend seems to use prepared parameterized statements, not string substitutions with pre-escaped values.
"	Bug	closed	Database layer (models, ORM)	1.1	Normal	needsinfo	jython	Leo Soto M.	Accepted	0	0	0	0	0	0
