> > I am trying to connect via SQLObject to the existing database
>
>    You didn't mention fromDatabase but I am sure that what you meant,
> right? Because it's certainly possible to connect to an existing database
> without it.
>
> > What I really can not figure out is how to get ForeignKey and
> MultipleJoin
> > working.
>
>    By declaring them yourself:
>
> class MyTable(SQLObject):
>    class sqlmeta:
>        fromDatabase = True
>    fk = ForeignKey('AnotherTable')
>    mj = MultipleJoin('AnotherTable', joinColumn='at_id')


Thanks for the syntax, it works great.

>
>   Explicit declarations are compatible with fromDatabase. And of course
> you are not obliged to use fromDatabase at all - just declare all you
> columns and joins yourself.
>

I have used fromDatabase  because my lazybones only.

  Of course IWBN if your patch fromDatabase machinery (methods
> columnsFromSchema and guessClass in Connection class) to recognize at least
> ForeignKeys.
>
> IWBN, I would like to. But, to be honest, I think my Pythonic skills are to
low for this task (it is REALLY not about the time or laziness).

Thanks and Best Regards

Petr
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to