OK, I've figured this much out so far. I've created one DTML document for each registration. I'm using acquisition to pass that document to a DTML method that displays the document. The URL looks like: ".../Yourfullname3b01efcd/DisplayFullRegInfo" where Yourfullname3b01efcd is the document name, and DisplayFullRegInfo is the DTML method.
Now I want to get the information in the document (which is a python dictionary in text form) and use eval() (which I've put in an external method) to parse it back into a python dictionary. To get the data in the document, it turns out all I have to do is say "PARENTS[0]". Now the fun starts. This is in DisplayFullRegInfo:
<dtml-let data="PARENTS[0]"> <dtml-var data><hr> <dtml-var expr="parseSeminarRegistration(data)"> </dtml-let>
I keep getting weird error messages for parseSeminarRegistration(), which worked in a different DTML method just fine. The messages complain about the argument, so I decide to examine the argument type. Here's the external method, parseSeminarRegistration():
import types def parseSeminarRegistration(code): return 'your type is: ' + str(type(code)) #return eval(code)
Normally I just use eval(), but this should indicate the type. Here's the output:
-----------------------------------------------------------
-------------------- {'homephone': 'Your home phone (for emergencies)', 'email': 'Your email address', 'admin_email': 'Their email address', 'price_dates': '(("2001-5-15", 1700), ("2001-7-4", 1800))', 'semnumber': '1', 'busphone': 'Your business phone number', 'admin_contact': "Person we should contact about payment, if it's not you", 'admin_phone': 'Their phone number', 'bill_to': 'Person or company paying for the seminar', 'payment_date': '', 'admin_fax': 'Their fax number', 'country': 'USA or your country', 'state': 'State or province', 'required_forms': '(("Limited Liability Form", "N", "http://www.mindview.net/Seminars/regFormParts/LimitedLiabi l ity"), ("Activity Release Form", "N", "http://www.mindview.net/Seminars/regFormParts/ActivityRele a seForm.html"))', 'name': 'Your full name', 'zip': 'Zip or postal code', 'city': 'City', 'invoice_number': '', 'current_price': '', 'seminar_id': 'Design-A-Day Patterns Practicum July 30-August 3 ', 'paid': 'N', 'purchase_order_id': '', 'registration_date': '2001/05/15 20:11:07.26156 GMT-7', 'completed': 'N', 'address1': 'Street address', 'address2': 'Second address line, if needed', 'fax': 'Your fax number, if you have one'} -----------------------------------------------------------
Progress: I figured out that the string exists, but it's being html-quoted, which suggests to me that the information from the file is somehow being passed rather than being opened by my 'DisplayFullRegInfo' DTML method. So I suspect I'm taking the wrong approach, and asking the wrong question. I think the question should be: Inside a DTML method that's called with an argument via acquisition (I may be misusing the term here), if the argument represents a DTML document name: http://www.foobar.org/place/TheArgument/TheDTMLMethod How do I (1) get TheArgument from inside TheDTMLMethod (methinks PARENTS[0], but that seemed to be problematic) (2) Open the DTML document, once I have the argument Thanks... *********** REPLY SEPARATOR *********** On 5/17/01 at 7:57 AM Bruce Eckel wrote: - -
-------------------- your type is:
The external method is clearly called, but it simply gives a blank. No 'None', even, as if *no* argument is being passed (which I didn't think was possible).
I'm clearly missing something here. (If there's a more appropriate way to get the data file then tell me to do that).
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================
_______________________________________________ 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 )
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================