SQLObject

C

ChrisW

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.

Thanks in advance for any help anyone is able to give.

Chris
 
D

Daniel Fetchinson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQLObject 0.13.0 0
SQLObject 0.14.0 0
SQLObject 0.9.0b1 0
Add the value taken from the user to my range for ActiveX ComboBox 0
SQLObject 0.9.0 3
SQLObject 1.1.0 0
SQLObject 0.10.0 0
SQLObject 0.8.0 0

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,160
Latest member
CollinStri
Top