Use the _registry class attribute:
class Cidade(SQLObject):
_registry =3D "site1"
...
It's just a string identifier to group objects together - all your classes f=
or
a site will need to have it set. This is for the global name registry in SO,
since for Joins and ForeignKeys you only specify the classes by name.
- Luke
Because of the need to identify classes by name when their
Quoting Michel Thadeu <mic...@ya...>:
> Hi guys!
>
> I having a problem I don=B4t know how to solve. I have tow different
> sites (made in webware) and hava two different modules to access two
> different database.
>
> The first site database was designed using the SQLObject=B4s createTable
> method. I have one table called cidade and another one called estado.
> The second site database was designed to another person, the database
> name convention is too strange. The cidade id is not called id or
> cidade_id, it is called cidaauct. So I need to specify each column=B4s
> name.
>
> The problem is that the webware are caching the Cidade class (I think),
> I have put a _cacheValues=3DFalse on the class without sucess (I put in
> all class), so I think the focus is the webware. If I acess the second
> site first and then the first site there is no problem, but if I try to
> access the first and then the second, the column estado_id is not
> found, i think when the sqlobject is trying to make the join.
>
> How can I specify to webware (if the problem is with webware), that
> Site1.Database1.Estado is not equal Site2.Database2.Estado, or anything
> like this?
>
> Does anyone have such problem?
>
> thanks for the attention, I will list the two classes code follow:
>
> File: Site1.Database1
> ...
> __CONNECTION__=3D'mysql://...'
>
> class Cidade(SQLObject):
> _connection=3D__CONNECTION__
> _cacheValues=3DFalse
> nome=3DStringCol(length=3D50)
> estado=3DForeignKey('Estado')
>
> class Estado(SQLObject):
> _connection=3D__CONNECTION__
> _cacheValues=3DFalse
> nome=3DStringCol(length=3D50)
> sigla=3DStringCol(length=3D2, alternateID=3DTrue)
> cidades=3DMultipleJoin('Cidade')
> ...
>
> File: Site2.Database2
> ...
> CONNECTION=3D'mysql://...'
>
> class Cidade(SQLObject):
> _connection=3DCONNECTION
> _idName=3D'codicida'
> _cacheValues=3DFalse
> nome=3DStringCol(dbName=3D'desccida')
> estado=3DForeignKey('Estado', dbName=3D'codiesta')
>
> class Estado(SQLObject):
> _connection=3DCONNECTION
> _idName=3D'codiesta'
> _cacheValues=3DFalse
> nome=3DStringCol(dbName=3D'descesta')
> sigla=3DStringCol(dbName=3D'siglesta', length=3D2, alternateID=3DTrue)
> cidades=3DMultipleJoin('Cidade')
> ...
>
> =3D=3D=3D=3D=3D
> --
> Michel Thadeu Sabchuk
> Curitiba/PR
>
> ______________________________________________________________________
>
> Yahoo! Mail - agora com 100MB de espa=E7o, anti-spam e antiv=EDrus gr=E1ti=
s!
> http://br.info.mail.yahoo.com/
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & Training.
> Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
> digital self defense, top technical experts, no vendor pitches,
> unmatched networking opportunities. Visit www.blackhat.com
> _______________________________________________
> Webware-discuss mailing list
> Web...@li...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
--
The Pursuit of Counterfactual Histories
|