[Zope3-dev] Re: ZopeX3 with sqlos

Derrick 'dman' Hudson dman at dman13.dyndns.org
Fri Jul 30 16:42:35 EDT 2004


On Mon, Jul 05, 2004 at 05:27:57PM -0400, Derrick 'dman' Hudson wrote:
[...]

| I also modified sqlobject/dbconnection.py.  Around line 434, I added
| the line
|     self.query = 'SELECT * FROM acl'
| right above where it says
|     if dbconn.debug:
|         dbconn.printDebug(rawconn, self.query, 'Select')
|     self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
| 
| 'ACL' is the name of the already-existing table I wanted to display
| the contents of.  I kept seeing invalid SQL statements being
| generated.  I don't know if that is a result of something else I set
| wrong or a bug in sqlobject's trunk revision.  This hack let me
| sidestep that issue for the time being.

Just for the record, I did eventually figure out what was wrong here.
In my SQLObject subclass, I had the following typo:
    _colulmns = [ ... ]
as a result, SQLObject would generate SQL statements like
    SELECT   FROM acl
    SELECT acl.id,   FROM acl

Clearly the bug was entirely mine and I just couldn't see it.  However
sqlobject should recognize and report the problem when a developer
declares a table with no columns.


The other problem I had -- needing to specify _connection= in the code
-- turned out to be caused by subclassing SQLObject (as the readme
says to) instead of SQLOS.


For anyone searching the archives -- sqlos does indeed work (and is
rather nice).  Don't give up if you run into some setbacks like the
ones I discovered.

-D

-- 
The Consultant's Curse:
    When the customer has beaten upon you long enough, give him
what he asks for, instead of what he needs.  This is very strong
medicine, and is normally only required once.
 
www: http://dman13.dyndns.org/~dman/            jabber: dman at dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20040730/04cff956/attachment.bin


More information about the Zope3-dev mailing list