SQLObject

CCW c.c.wood at gmail.com
Tue Sep 29 04:01:54 EDT 2009


On Sep 28, 9:41 pm, Daniel Fetchinson <fetchin... at googlemail.com>
wrote:
> > I'm new to using SQLObject, and having some problems with getting it
> > to recognise my current MySQL database.
>
> > I've set up my connection fine, but it won't recognise the names of
> > the columns (presumably because they're not written using the default
> > naming convention?).  For example, one of my columns is an acronym, so
> > is 3 uppercase letters.  I've tried the following:
>
> > class Table1(sqlobject.SQLObject):
> >   _connection = conn
> >   _fromDatabase = True
>
> >   class sqlmeta:
> >      table = 'Table1'
> >      idName = 'Table1ID'
>
> >   BOB = StringCol()
>
> > print Table1.get(1)
>
> > this gives the result
>
> > Unknown column 'bo_b' in 'field list'
>
> > So, specifically a few questions:
>
> > I've seen the attribute in class sqlmeta of 'columns' - will this find
> > my column names automatically, or do I still need to input them
> > manually? If the latter..:
>
> > I assume I set the names of each column in the instance of sqlmeta
> > (like I have done with the table name) - how do I do this?! Do I do
> > this before or after I've told SQLObject that the BOB column is a
> > String column?
>
> > Is there a published list of the default naming convention that
> > SQLObject follows? I couldn't find it on the website.
>
> The current maintainer of sqlobject is Oleg Broytmann and he
> frequently answers support questions on the sqlobject mailing list so
> it's best to ask questions such as these over there:https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>
> HTH,
> Daniel
>
> --
> Psss, psss, put it down! -http://www.cafepress.com/putitdown

Thanks for this - have reposted there.

Chris



More information about the Python-list mailing list