Hi, I'm starting to develop a zope products and I'm still confused on how to use ZODB. My current application development is using RDBMS concept such as following samples: employee table: Row First Name Last Name Age === ========== ========= === 1 Bob McBob 42 2 John Johnson 24 3 Steve Smith 38 - I can easily perform SQL statement to lookup for some information such as, total employee, who are above 30 years old, and who has the Lastname of 'Smith'. - I can easily retrieve information from multiple tables and combine it as data objects. But how can I do this in ZODB? I was looking at http://www.zope.org/Documentation/Books/ZDG/current/index_html but it just tell me briefly how to store objects and simple retrieval. I need to do complex queries or perform some transaction. Can anyone help me the way to query data in ZODB? thanks, Heri
On Tuesday 11 March 2003 15:37, Heri wrote:
But how can I do this in ZODB? If you have complicated structure, RDBMS is probably much better (and more safe) choise than ZODB.
-- Regards, Bogdan Remember the... the... uhh.....
But by using RDBMS this would mean, I can use only 1 product type for entire zope instance? Unlike ZODB I can create multiple instances of the a product (in different folder) and the instances don't conflict with each other? regards, Heri ----- Original Message ----- From: "Bo M. Maryniuck" <b.maryniuk@forbis.lt> To: "Heri" <htan@gmx.de>; <zope@zope.org> Sent: Tuesday, March 11, 2003 9:43 PM Subject: Re: [Zope] Understand ZODB Query?
On Tuesday 11 March 2003 15:37, Heri wrote:
But how can I do this in ZODB? If you have complicated structure, RDBMS is probably much better (and more safe) choise than ZODB.
-- Regards, Bogdan
Remember the... the... uhh.....
Heri wrote at 2003-3-11 22:10 +0800:
But by using RDBMS this would mean, I can use only 1 product type for entire zope instance?
You can differentiate with a special column in your table.
Unlike ZODB I can create multiple instances of the a product (in different folder) and the instances don't conflict with each other?
The value of your differenting column could be the path to the folder. Dieter
Heri wrote:
Hi,
I'm starting to develop a zope products and I'm still confused on how to use ZODB.
My current application development is using RDBMS concept such as following samples:
employee table: Row First Name Last Name Age === ========== ========= === 1 Bob McBob 42 2 John Johnson 24 3 Steve Smith 38
- I can easily perform SQL statement to lookup for some information such as, total employee, who are above 30 years old, and who has the Lastname of 'Smith'. - I can easily retrieve information from multiple tables and combine it as data objects.
But how can I do this in ZODB?
I was looking at http://www.zope.org/Documentation/Books/ZDG/current/index_html but it just tell me briefly how to store objects and simple retrieval. I need to do complex queries or perform some transaction.
Can anyone help me the way to query data in ZODB?
thanks, Heri ZODB has no query language. But by using ZCatalog indexing mechanism and coupling it to Python code, you can write your own queries for data stored in ZODB.
Please others, correct my wording where incomplete/incorrect
On Tuesday 11 March 2003 15:47, Godefroid Chapelle wrote:
ZODB has no query language.
http://213.133.101.80:8080/iuveno/Products/ZOQLMethod -- Regards, Bogdan The reason computer chips are so small is that computers don't eat much.
Bo M. Maryniuck wrote:
On Tuesday 11 March 2003 15:47, Godefroid Chapelle wrote:
ZODB has no query language.
Seeing that it has not been maintained from January 2001 makes me feel prudent... but I never used it.
On Tuesday 11 March 2003 16:43, Godefroid Chapelle wrote:
Bo M. Maryniuck wrote:
On Tuesday 11 March 2003 15:47, Godefroid Chapelle wrote:
ZODB has no query language.
Seeing that it has not been maintained from January 2001 makes me feel prudent... but I never used it.
It's because probably bug-free... ;-) -- Regards, Bogdan Favorite MS-DOS error message: "Drive C: not ready, close door."
- I can easily perform SQL statement to lookup for some information such as, total employee, who are above 30 years old, and who has the Lastname of 'Smith'. - I can easily retrieve information from multiple tables and combine it as data objects.
But how can I do this in ZODB?
1) If your data set is not too big, you can do it programmatically Python: set = folder.objectValues() results = [] for elt in set: if (elt.age > 30) and (elt.lastname=='Smith'): results.append(elt) return elt One can easily replace '30' and 'Smith' with parameters to get a more useful script. 2) Use ZCatalog for this if you have larger sets to avoid unnecessary traversals. But I suspect the larger problem is that you're thinking tabularly. Trying to make a 1-to-1 translation between an object-storage scheme and a relational-storage scheme isn't always (or maybe usually) going to work. I know no magic processes for this, unfortunately. --jcc
participants (5)
-
Bo M. Maryniuck -
Dieter Maurer -
Godefroid Chapelle -
Heri -
J Cameron Cooper