Re: SqlObject Sqlmeta fromDatabase problem
Petr Jakeš <[email protected]>
| Newsgroups | gmane.comp.python.sqlobject |
|---|---|
| Message-ID | <CAERU-VZt-Wsf9ROg5OG0F8Wd1-wJL7nvGSWDfyso3MhKdiod2w@mail.gmail.com> |
> fromDatabase: A boolean (default false). If true, then on class creation > the database will be queried for the table's columns, and any missing > columns (possible all columns) will be added automatically. > I started with these > class Company(SQLObject): > class sqlmeta: > fromDatabase = True > lazyUpdate = False > cacheValues = True > Company_Name = StringCol(length = 256, default = None) > Company_Address = StringCol(length = 256, default = None) > Company_Phone = StringCol(length = 256, default = None) > > Added > class Company(SQLObject): > class sqlmeta: > fromDatabase = True > lazyUpdate = False > cacheValues = True > Company_Name = StringCol(length = 256, default = None) > Company_Address = StringCol(length = 256, default = None) > Company_Phone = StringCol(length = 256, default = None) > *Company_Number = StringCol(length = 256, default = None)* > > class Companys(): > def __init__(self): > Company.createTable(ifNotExists = True, connection=conn) > > > Hi Jeremy, what about the Naming Style? see: Changing the Naming Style <http://sqlobject.org/SQLObject.html#id56> .... By default names in SQLObject are expected to be mixed case in Python (like mixedCase), and underscore-separated in SQL (like mixed_case). This applies to table and column names. Regards Petr ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ sqlobject-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss