Re: [SQLObject] legazy database, fromDB and mixed-case column names
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Hartmut G. <h.g...@go...> - 2006-02-13 11:48:23
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Oleg Broytmann schrieb: > class Device(SQLObject): > class sqlmeta: > table = 'Device' > > sysName = StringCol(dbName="sysName", default=None) > > Oleg. Thanks, this gave me this idea class Device(SQLObject): class sqlmeta: fromDatabase = 1 table = 'Device' for colname in ['sysName', 'anotherColumn']: Device.sqlmeta.columns[colname].dbName = colname Thus there is no need to redefine the columns, since only the db-names are changed. - -- Sch?nen Gru? - Regards Hartmut Goebel | Hartmut Goebel | IT-Security -- effizient | | h.g...@go... | www.goebel-consult.de | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iQEVAwUBQ/Bx48zajR0mSa83AQLrRAgAjUlYTPcn4aYNav+b8mbFZ6lT7DZJ9Lxl h4lqWs5T/9lBPOQYFpjupzOxFKQUzeL7Dfm3UUBytYSvnsF9VUbAu+FD5mcH49/+ 8586sc4cantefCajH1ra89W5kZROB5YNjsZUmQlnNksPmrRbj24wG3aMVuO0GhPM ZstrT9usAsxRmRi9/1QU/UtwRrYQl5Q+ycXauM4qtHR4o65UInC4Rpo2Hea99MSD er69ARxg60ByMde1sllMfc6t6qu2/fCq7fQkOhH4D9wH7XlBU6sagQuUdv1o7n6g i3K3Joj+wNKGJjVwuwW43NlLMKHasSjX+Rki6h3jPa+PVk/9LmUa2w== =f2AH -----END PGP SIGNATURE----- |