I wonder if there exist examples of how Ape was used to integrate an existing RDB into Zope. The webpage says: Ape, the Adaptable Persistence Engine, adapts Python objects to storage on the filesystem, in relational databases, or practically anywhere else. But I want to do it the other way... adapt Python objects to represent data in a relational database. Do you have any pointers about this? Or other products that could be of interest? For reference: http://thread.gmane.org/gmane.comp.web.zope.plone.user/30269 -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: madduck.bogus@madduck.net "in just seven days, i can make you a man!" -- the rocky horror picture show
martin f krafft wrote:
But I want to do it the other way... adapt Python objects to represent data in a relational database.
Shane is your man for this. But APE is actually designed for doing exactly what you want, and that's the way it's most commonly used. I thought you were asking if you could make a relational table visible as Zope objects using APE, which it can theoretically do, and which I'm VERY interested in ;-) Hoever, not only is that not what you're asking for, but you may find ZSQL methods easier to get what you're after anyway :-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
also sprach Chris Withers <chris@simplistix.co.uk> [2005.02.11.1313 +0100]:
But I want to do it the other way... adapt Python objects to represent data in a relational database.
Shane is your man for this.
Shane, come and join me for a beer then!
But APE is actually designed for doing exactly what you want, and that's the way it's most commonly used.
My understanding is that it is most commonly used to store data somewhere else (e.g. a RDB) rather than in the ZODB. This is not necessarily what I want to do, although it is part of it. Let me admit that I have not really looked at Ape in depth. I am pressed for time to deliver a solution and therefore chose to invest some time into surveying rather than diving into solutions that may eventually be hacked/moulded to do what I want, when better alternatives exist. I want to make my exisiting RDB available in Zope, intuitively, automatically, and robustly. I want records created in the database outside of Zope to show up as objects in Zope automatically. The same applies to deletions. I want objects created through Zope to create appropriate records in the RDB. The same applies to deletions. I want to be able to edit objects and have the changes percolate to the database. I also want changes in the database to show up in the objects. Is this what Ape is all about?
I thought you were asking if you could make a relational table visible as Zope objects using APE, which it can theoretically do, and which I'm VERY interested in ;-)
Yes, this is what I am asking, I think. Are there any examples of this? Ape looks complicated and before diving into the theory, I'd rather explore it in action first.
Hoever, not only is that not what you're asking for, but you may find ZSQL methods easier to get what you're after anyway :-)
ZSQL methods are objects representing data relations, not records or instances in those. I know I can use a ZSQL method to get at and store data in a RDB. I also know I can use special URLs to give the impression of virtual objects, marshalled by the ZSQL method. However, I am looking to provide folderish objects which can also hold CMF objects. Think about a scientific publication: All our publications are in the RDB so that we can easily manage m:n relationships to authors (RDBs just excel at that, and even though you can do it in ZODB, it's not the best tool for the job). For every publication, we want the ability to store a PDF for access on the Zope-driven website. I want these files to be in the ZODB, since they are objects themselves, and I have never felt comfortable storing objects in fields of a RDB. So I want a way to associate a folderish Archetype (essentially just a folderish CMF type) with a RDB table so that an instance thereof obtains and manages some of its associated data from/in the RDB. At the same time, the instance should also feel like a regular ZODB object, which I can copy/paste, and in which I can store objects for management by the ObjectManager. Will Ape help me here? Do you know of any product that does something similar? Can you think of how to approach this? Thanks, -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: madduck.bogus@madduck.net "i am a deeply superficial person." -- andy warhol
martin f krafft wrote:
My understanding is that it is most commonly used to store data somewhere else (e.g. a RDB) rather than in the ZODB. This is not necessarily what I want to do, although it is part of it.
I'm not sure APE is "commonly" used for anything...
I want to make my exisiting RDB available in Zope, intuitively, automatically, and robustly.
Yep, that sounds like one of APE's deisgned usecases, and the one that most interests me...
I want records created in the database outside of Zope to show up as objects in Zope automatically. The same applies to deletions.
Any particular type of Zope object? <snip>
Is this what Ape is all about?
Yep.
Yes, this is what I am asking, I think. Are there any examples of this? Ape looks complicated and before diving into the theory, I'd rather explore it in action first.
Shane?
ZSQL methods are objects representing data relations, not records or instances in those.
That's a matter of opinion, I believe you can probably get what you're after, and maybe even more quickly than with APE or SQLObject.
However, I am looking to provide folderish objects which can also hold CMF objects.
I thought you'd be heading there, good luck, I think you'll need it!
So I want a way to associate a folderish Archetype (essentially just a folderish CMF type) with a RDB table so that an instance thereof obtains and manages some of its associated data from/in the RDB.
That sounds like a question for the Archetypes list, I think they have some way to deal with this... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
also sprach Chris Withers <chris@simplistix.co.uk> [2005.02.14.1323 +0100]:
I want to make my exisiting RDB available in Zope, intuitively, automatically, and robustly.
Yep, that sounds like one of APE's deisgned usecases, and the one that most interests me...
That makes two of us.
I want records created in the database outside of Zope to show up as objects in Zope automatically. The same applies to deletions.
Any particular type of Zope object?
An Archetype.
However, I am looking to provide folderish objects which can also hold CMF objects.
I thought you'd be heading there, good luck, I think you'll need it!
Argh. I only have a week.
So I want a way to associate a folderish Archetype (essentially just a folderish CMF type) with a RDB table so that an instance thereof obtains and manages some of its associated data from/in the RDB.
That sounds like a question for the Archetypes list, I think they have some way to deal with this...
Been there, done that. No, they don't. :( http://cvs.ailab.ch/cgi-bin/viewcvs.cgi/external/SQLWindow/ is my current WIP result. -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: madduck.bogus@madduck.net gentoo: for when you finally find out that overclocking can kill your processor.
Il giorno lun, 14-02-2005 alle 13:32 +0100, martin f krafft ha scritto:
ith this...
Been there, done that. No, they don't. :(
http://cvs.ailab.ch/cgi-bin/viewcvs.cgi/external/SQLWindow/
is my current WIP result.
uh, so much different from the Ape approach. It shares with SQLStorage some of the issues due to the double storage layer. Do you tried my recipe?:) -- azazel <azazel@lizard.homelinux.net>
also sprach azazel <azazel@lizard.homelinux.net> [2005.02.14.1356 +0100]:
uh, so much different from the Ape approach. It shares with SQLStorage some of the issues due to the double storage layer. Do you tried my recipe?:)
No, I have not had the time. I will. :) -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: madduck.bogus@madduck.net "if you stew apples like cranberries, they taste more like prunes than rhubarb does." -- groucho marx "in diving to the bottom of pleasure we bring up more gravel than pearls." -- honoré de balzac
participants (3)
-
azazel -
Chris Withers -
martin f krafft