[Z3-sqlos] Schema declaration for RelatedJoin
Anders Bruun Olsen
anders at bruun-olsen.net
Thu Jun 8 22:15:14 CEST 2006
Hi,
I'm playing around with sqlos to get to know it better. I have worked a
little bit with sqlobject in the past and I am porting an old Zope2 app
I wrote (which uses MySQL to store data) to Zope3 with sqlos. In all
simplicity it is a database for books. I have defined a person class and
a book class along with there respective SQLObjectContainer classes. Now
I need to be able to associate a person with a book to define authors.
I do that by adding a RelatedJoin attribute to both classes.
But how do I specify this in my schema?
I have googled it and it seems that only a russian has written anything
on the internet with the words sqlos and relatedjoin in the same
sentence :). I couldn't understand the messages but the code seems to
suggest using List(value_type=Choice()). But Choice needs a vocabulary,
which for the person class would of course be BookContainer and
vice-versa for the book class. But not only are vocabularies quite a
difficult thing to understand, but in Web Component Development with
Zope 3, Philipp von Weitershausen writes that vocabularies have been
deprecated in favor of sources. I have taken a look at ISource but is it
just enough to declare that my SQLObjectContainers implement ISource?
And how do I correctly declare the source for Choice?
Am I even close here, or is there a much better way to handle this?
--
Anders
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V
PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y?
------END GEEK CODE BLOCK------
PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0
More information about the z3-sqlos
mailing list