[Zope3-Users] Referencing objects

Michael Seifert michael.seifert at gmx.net
Fri Feb 4 09:38:04 EST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,

I recently started a Zope3 project, but I am stuck at the very
beginning. Although I have some experience with Zope2, the more flexible
approach to developing web applications was giving me a really hard
start. Let me point out my situation:
I created a container hierarchy which is stored in ZODB. Say I have a
set of object types A, B, C, D, whose relationships look like the
following (edges represent containment, i.e. A contains B,... where B
and D are in subcontainers of A):

    A
   / \
  B   D
  |
  C

C has an attribute referencing an object of type D. As this attribute is
mandatory on creation, I created a vocabulary, which ascends the
hierarchy from the current context until it reaches A and returns all
objects of type D.
Now the part that doesn't work:
While ascending from C to B and from B to A works fine, descending from
A to D returns a security proxied object and since these objects cannot
be pickled, I cannot store it's reference in the attribute of C.

1. Is this the way it's meant to be done? :) What is your opinion of
storing B and D objects in subcontainers of A?
2. Are there any means to turn the vocabulary into trusted code, so it
will not be encapsulated in a proxy (without deactivating the security
proxy)?
3. How do you reference objects like you do with foreign keys in
relational databases? I want to do this to prevent objects from being
saved multiple times.


Thanks in advance and best regards
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1MD0wACgkQnzX+Jf4GTUx3BQCggto6AFnXLiyl6JRaYY634KXG
0SAAoKm+/jug8BNYhpZaOa6weroZmsg+
=IQ4T
-----END PGP SIGNATURE-----


More information about the Zope3-users mailing list