On Aug 26, 2005, at 2:37 PM, Randall Smith wrote:

I'm referencing tables with there schema name such as schema.table and this causes an occasional problem in SQLObject which I have to work around.

I'm setting table like:

    class sqlmeta:
        table = 'planreview.project'

One example problem is a join such as this:

    actions = MultipleJoin('Action')

Which generates this SQL:

    SELECT id FROM planreview.action WHERE planreview.project_id = 1

I have to do work arounds to get this to work such as specifying dbName or issuing connection.query('set search_path ....')

What's the cleanest way to deal with table names that must be prefixed with the schema name.

If the other table lists the schema in the table sqlmeta, it should generate working SQL. For example, here's two tables from my database that are in separate schemas using a join across them.

class Resource(SQLObject):
    class sqlmeta:
        table = 'web_assets.resource'
    title = StringCol(length=255)
    accessGroups = RelatedJoin('AccessGroup',joinColumn='resource_id', otherColumn='group_id',

class AccessGroup(SQLObject):
    class sqlmeta:
        table = 'security.access_group'
    name = StringCol(length=80)
    resources = RelatedJoin('Resource',joinColumn='group_id', otherColumn='resource_id',

Does your Action class have the schema prefixed to it as well?

- Ben