* Robert Schöftner [2013-08-20 09:30 +0200]: >Am 2013-08-20 01:43, schrieb Demoy Blake: >> Hello, I am trying to change the address of a party using the database >> cursor, below is the SQL statement but its not working. >> >> cursor.execute('UPDATE party_address ' >> 'SET country = 111, ' >> 'street = "pen" ' >> 'WHERE party = 111') >> >> #below is the error message i keep receiving >> >> res = self.cursor.execute(sql) >> psycopg2.ProgrammingError: column "pen" does not exist >> LINE 1: UPDATE party_address SET country = 111, street = "pen" WHERE... >> >postgresql expects single quotes for string-literals, double quotes for >column/table names.One might also wonder why Demoy would like to bypass Tryton's ORM. It is usually a bad idea.thank you for the advice, Hi Évrard how might I alter a specific party address without resulting to sql statements
Due to the switch to the active record pattern it is now quite easy to
change the value of field:
http://hg.tryton.org/modules/sale_supply/file/5c867861be6e/sale.py#l29
--
Nicolas Évrard
B2CK SPRL
4, rue de Rotterdam
4000 Liège
Belgium
Tel: +32 472 54 46 59
E-mail/Jabber: [email protected]
Website: http://www.b2ck.com/
signature.asc
Description: Digital signature
