ZODB: When to use IDs when references?
Up to now I used relational databases. Now I don't know when it is better to use IDs and when to use references. Background: I write a Multiple Choice Python Product. There is a list of questions and a list of users. Both get combined in the "result" class. Should the class "result" have references to the questions or store the question-IDs? Any ideas welcome! -- Open Source Software Solutions Thomas Guettler <thomas@thomas-guettler.de> http://www.thomas-guettler.de
I would probably store the results in a dict like structure with the user id as the key. results['maxm'] = (some, replys) But it really is more of a question about how you want to use the data. regards Max M Max M. W. Rasmussen, Denmark. New Media Director private: maxmcorp@worldonline.dk work: maxm@normik.dk ----------------------------------------------------- Shipping software is an unnatural act
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Thomas Guettler Sent: Thursday, August 23, 2001 7:36 PM To: zope@zope.org Subject: [Zope] ZODB: When to use IDs when references?
Up to now I used relational databases. Now I don't know when it is better to use IDs and when to use references.
Background: I write a Multiple Choice Python Product. There is a list of questions and a list of users. Both get combined in the "result" class. Should the class "result" have references to the questions or store the question-IDs?
Any ideas welcome!
-- Open Source Software Solutions Thomas Guettler <thomas@thomas-guettler.de> http://www.thomas-guettler.de
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Thomas Guettler writes:
Up to now I used relational databases. Now I don't know when it is better to use IDs and when to use references.
Background: I write a Multiple Choice Python Product. There is a list of questions and a list of users. Both get combined in the "result" class. Should the class "result" have references to the questions or store the question-IDs? Ids (or paths) will give you fewer hasles...
References (understood as direct object references) can only be handled in External Methods and Python products. Even there, they are difficult: * you can not store "wrapped" objects in the ZODB, i.e. you need to use "aq_base" before you store them * when they are fetched, the appear at the new place in the site hierarchy not the original place. Dieter
participants (3)
-
Dieter Maurer -
Max M -
Thomas Guettler