adding database records programitically
hi, there, i have a few folders lying around in zope, and each of these folders contains a set of dtml-methods. each of the folders represents a page inside the website we are hosting. the dtml-methods hold the content for the pages. this kind of setup worked nice for a long time, but now there are too much folders, too much methods to maintain, and I am planning to move the contents into the database. I want to avoid typing all the data in again, because that has been done already. I tried this: <dtml-in "objectValues(['Folder'])"> <dtml-with "_['sequence-item']"> <dtml-call "a_sql_method_to_add_the_thing_into_the_database"> </dtml-with> </dtml-in> but this approach did not work for me. if i use <dtml-with nameOfFolder>, everything works fine, but iterating over the folders and using <dtml-with "_[sequence-item']"> did not. Andy Pahne, ap@net22.net net22 GmbH Bad Meinberger Strasse 1 32760 Detmold 0 52 31 - 580 640 http://www.net22.net
on Friday, May 05, 2000 Andy Pahne wrote : AP> hi, there, AP> i have a few folders lying around in zope, and each of these folders AP> contains a set of dtml-methods. each of the folders represents a page inside AP> the website we are hosting. the dtml-methods hold the content for the pages. AP> this kind of setup worked nice for a long time, but now there are too much AP> folders, too much methods to maintain, and I am planning to move the AP> contents into the database. AP> I want to avoid typing all the data in again, because that has been done AP> already. I tried this: AP> <dtml-in "objectValues(['Folder'])"> AP> <dtml-with "_['sequence-item']"> AP> <dtml-call "a_sql_method_to_add_the_thing_into_the_database"> AP> </dtml-with> AP> </dtml-in> AP> but this approach did not work for me. if i use <dtml-with nameOfFolder>, AP> everything works fine, but iterating over the folders and using <dtml-with "_[sequence-item']">> did not. perhaps (untested) <dtml-in "objectItems(['Folder'])"> would work better ? - and i don't think you need the <dtml-with "_['sequence-item']"> line.. Just a shot in the dark .. -- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
participants (2)
-
Andy Pahne -
Geir B�kholt Hansen