Problems with django admin on Jython with custom user models
|Reported by:||gbauer||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.1|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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) ...
self <doj.backends.zxjdbc.postgresql.base.CursorWrapper object at 0x4af>
'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.
Change History (10)
comment:1 Changed 7 years ago by leosoto
- Cc leosoto added
- Keywords jython added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 7 years ago by russellm
- Resolution set to invalid
- Status changed from new to closed
comment:3 Changed 7 years ago by gbauer
- Resolution invalid deleted
- Status changed from closed to reopened
comment:4 Changed 7 years ago by russellm
- Component changed from django.contrib.admin to Database layer (models, ORM)
- Triage Stage changed from Unreviewed to Accepted