[Zope] How do I create a folder full of "virtual" DTML objectsfrom records in a database records in a database

R. David Murray bitz@bitdance.com
Thu, 24 Aug 2000 20:08:01 -0400 (EDT)


On Thu, 24 Aug 2000, Chris Beaumont wrote:
> Thank you, I've been successful in setting up basic SQL methods, data
> input forms and query forms,
> the problem Ive been having is in trying to break each table record (one
> row in a table, say) out into a separate DTML document.. with fields in
> the record forming the parts of the document..  (I'm making a web
> heirarchy of events which each have to have their own page with various
> kinds of constantly changing information about the event on them.. 
> These pages have to live at relatively stable URLs.. (of course, it
> doesnt matter if they are physical documents to a search engine..)
[...]
> What I want to build are lists *and their linked documents*  the
> records' fields flowing into  the meta tags and body text of many
> individual objects. When a record is deleted from the source SQL table,
> I want to be able to have that deletion propagate to the child
> document..

Maybe I'm misunderstanding your question, or maybe I'm misuderstanding
ZSQL methods <grin>, because it does seem pretty straightforward to me.
I haven't done what I'm about to describe, though, so I could be way
off base.

It seems to me that what you want to do is have a ZSQL method that
takes an argument from the URL (they can do that), where the argument
is the 'id' of the record.  Then your method uses that argument to
retrieve *just* that row from your database.  Then you have your
html template filled in using the column variables from that record.
No need to have actual document objects sitting around, just the
template.  If you delete a record the corresponding page is therefore
gone.  And you get stable URLs, if the ids don't change:

http://www.yoursite.com/yourmethod/recordid

--RDM