[Zope] a modified shopping cart in dtml

Jason Trost jason.trost@descipher.com
Tue, 30 Jul 2002 00:54:14 -0500


Hello group,

Long time listener, first time caller.  I'm having trouble getting the 
functionality out of Zope that I want to.

Most of my problems boil down to how and when to call objects. Here it goes:

I want to make an page much like the shopping cart example in that all 
actions take place on the same page while using session variables.  (1) 
First the user searches for an item via a python script, and it returns all 
of the matches with the soundex algorithm.  (2) It takes that variable, 
plugs it into a SQL call.  SQL returns say a few items and from that (3) 
the user selects one.  (4) The user then selects a value for that item, it 
gets put into the "shopping cart" and (5) the process is repeated.  (6) 
Once the user is done they move onto the next page.  Confused yet? :-)

So my first problem dealt with getting a dtml-document to return to the 
same page.  I finally got this to work with

return container.index_dtml(context).

I was missing context for the longest time and the dtml couldn't find any 
variables.  Is this the right way to do it?

How do I retrieve a session variable in the command <dtml-var 
something.something>?

How do I retrieve a session variable from the name space so that I can plug 
it into a SQL command in the index_html document itself after the form 
returns?  I tried to do it through python but it returned a pointer to that 
object.  It came from the example in the Zope Book.

I tried to model most of this after the shopping cart example but I didn't 
like the syntax of page templates.  Is dtml generally better than pages in 
templates?  Or vice versa?  WYSIWYG editing isn't important to me some I'm 
learning towards dmtl.



Here's a last random question:

Is the login for Zope management interface encrypted?  Do I need to install 
the SSL work around through Apache to secure that?


Thanks very much!  Sorry for being long winded.

Love the group,
Jason




Jason Trost
jason.trost@descipher.com
www.descipher.com