Ok found it .... it was mod_python fault, which now return StringField 
instances in place of str !

Julien Cigar wrote:
> Hello,
>
> Any idea why I get those errors with psycopg2 (not with psycopg1) :
>
> SQLError: (ProgrammingError) can't adapt 'SELECT habitats.id AS 
> habitats_id, habitats.habitat AS habitats_habitat \nFROM habitats 
> \nWHERE habitats.id = %(habitats_id)s ORDER BY habitats.id' 
> {'habitats_id': '2'}
>
> What's strange is that I don't have this in the python console when I 
> issue a query ...
> I'm almost sure that it's an Unicode problem (everything is in 
> Unicode) ...
>
> I'm connection with:
> db_engine = create_engine('...', encoding='utf-8')
>
> This fails :
> form_habitats = self.params.getlist('invasive_habitats')
> for hab in form_habitats:
>    habitat_object = query_habitat.get(hab)
>    (...)
>
> If i do like this it works :
> form_habitats = self.params.getlist('invasive_habitats')
> for hab in form_habitats:
>    habitat_object = query_habitat.get(hab.decode('utf-8'))
>    (...)
>
> Any enlightenment ?
>
> Thanks,
> Julien
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to