[Zope] snippets (was RE: [Zope] Where do I find out about cookies?)
Hi RDM Thanks! That works perfectly, and teaches me about namespaces. I just had to fix '' (I also do that):: Here's a shortened version of my own, from Squishdot. Instead of this:: 1"> ( comments, in body) ( comment, in body) ( in body) I made this:: ( comment 1">s, in body) -- Jean Jordaan --technical writer-- Mosaic Software--Zope 2.1.6 on WinNT and W2K ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Where do I find out about cookies?
On Fri, 25 Aug 2000, Jean Jordaan wrote: > > > REQUEST.form['sort_key'])"> > > > REQUEST.cookies['sort_key'])"> > > > > > [...] > Since anything in any of the REQUEST dictionaries is on the name space stack, you should be able to reduce the above IF block to: If the 'cookie' dictionary is "closer" than the 'form' dictionary in the namespace stack you'd need to stick one more REQUEST.set in the inner if. Obviously, I haven't tested this :) --RDM ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Where do I find out about cookies?
Hi Loren, J. Atwood, Maik Thanks for all the info! I'll digest & give feedback where I can. In the meantime, this is what I've fixed up for myself (with a LOT of help from Roche Compaan) .. In DTML Document 'index_html':: In DTML Method 'docsSorted':: Title Origin Series [Edit] [... and so on for the other possibilities ...] The rationale is: 'docsSorted' is called as method by 'index_html'. - Upon the first iteration, there is no cookie and no form variable. A cookie and a form variable is set to 'title' as default. The form variable governs. - Upon subsequent iterations, if there is a form variable, then 'index_html' was called from 'docsSorted' and the sort-order has *just* changed. The cookie is changed (which will not be noticed during this iteration since it first has to be received again) and the form variable governs. - If there is a only a cookie and no form variable, it governs. Now I want to extend it so that choosing a sort-order for the *second* time reverses the order -- does this really entail repeating the entire '' section for '"order=='reverse'"'? I think I'm probably better off using the catalog for this, rather than dtml-in batching .. -- Jean Jordaan --technical writer-- Mosaic Software--Zope 2.1.6 on WinNT and W2K ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Where do I find out about cookies?
Hi Jean ! Jean Jordaan wrote: > It looks like I'm going to be using cookies now, and I don't find any > How-To on cookies. I am collecting everything on cookies in the developers portal of the ZDP: http://zdp.zope.org/portals/developers/sessionmanagement/cookies Hope this helps. Once you have done more research, maybe you can give some feedback, so I can add it to the ZDP ? Best regards, Maik Röder -- "The computing future is based on "cyberbodies" - self-contained, neatly-ordered, beautifully-laid-out collections of information, like immaculate giant gardens." The second coming - A manifesto. David Gelernter http://www.edge.org/3rd_culture/gelernter/gelernter_p1.html ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Where do I find out about cookies?
No How-Tos on Cookies? how about http://www.zope.org/Members/BwanaZulia/cookies/ (I had forgotten to request it to be cataloged now down). Enjoy, J > From: Jean Jordaan <[EMAIL PROTECTED]> > Date: Thu, 24 Aug 2000 09:53:10 +0200 > To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> > Subject: [Zope] Where do I find out about cookies? > > Hi Zopers > > It looks like I'm going to be using cookies now, and I don't find any > How-To on cookies. What's the most instructive place to look? "UTSL" is > fine as an answer, especially if it points me somewhere, and even more > if it's DTML source .. > > The *ZQR* is a bit too cryptic for me. The *DTML Ref* has a bit more:: > > 8. Dictionaries are objects that support looking of data by name > (e.g. REQUEST.cookies['CUST_ID'] to look up a cookie named CUST_ID). > Dictionaries have has_key methods for checking whether a dictionary > contains a value (e.g. REQUEST.cookies.has_key('CUST_ID') ) and > methods keys , values , and items , for updating lists of dictionary > keys, values, and key-value pairs (e.g. REQUEST.cookies.keys() to > obtain a list of cookie names). > > .. but I don't understand yet how 'keys', 'values' and 'items' are going > to help me *update* the lists -- it seems to refer only to querying > them, AFAICS .. > > -- > Jean Jordaan --technical writer-- > Mosaic Software--Zope 2.1.6 on WinNT and W2K > > ___ > Zope maillist - [EMAIL PROTECTED] > 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 ) > > ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Where do I find out about cookies?
From: "Jean Jordaan" <[EMAIL PROTECTED]> > It looks like I'm going to be using cookies now, and I don't find any > How-To on cookies. What's the most instructive place to look? "UTSL" is > fine as an answer, especially if it points me somewhere, and even more > if it's DTML source .. > > The *ZQR* is a bit too cryptic for me. First you must understand cookies independent of Zope: http://home.netscape.com/newsref/std/cookie_spec.html Then Zope's interface to them will be easier to understand: >The *DTML Ref* has a bit more:: > > 8. Dictionaries are objects that support looking of data by name > (e.g. REQUEST.cookies['CUST_ID'] to look up a cookie named CUST_ID). > Dictionaries have has_key methods for checking whether a dictionary > contains a value (e.g. REQUEST.cookies.has_key('CUST_ID') ) and > methods keys , values , and items , for updating lists of dictionary > keys, values, and key-value pairs (e.g. REQUEST.cookies.keys() to > obtain a list of cookie names). > > .. but I don't understand yet how 'keys', 'values' and 'items' are going > to help me *update* the lists -- it seems to refer only to querying > them, AFAICS .. Search for "cookie" a little further in http://www.zope.org/Members/ZQR/zqr/normal and you will find not only REQUEST.cookies but also RESPONSE.setCookie(). -- Loren ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] Where do I find out about cookies?
Hi Zopers It looks like I'm going to be using cookies now, and I don't find any How-To on cookies. What's the most instructive place to look? "UTSL" is fine as an answer, especially if it points me somewhere, and even more if it's DTML source .. The *ZQR* is a bit too cryptic for me. The *DTML Ref* has a bit more:: 8. Dictionaries are objects that support looking of data by name (e.g. REQUEST.cookies['CUST_ID'] to look up a cookie named CUST_ID). Dictionaries have has_key methods for checking whether a dictionary contains a value (e.g. REQUEST.cookies.has_key('CUST_ID') ) and methods keys , values , and items , for updating lists of dictionary keys, values, and key-value pairs (e.g. REQUEST.cookies.keys() to obtain a list of cookie names). .. but I don't understand yet how 'keys', 'values' and 'items' are going to help me *update* the lists -- it seems to refer only to querying them, AFAICS .. -- Jean Jordaan --technical writer-- Mosaic Software--Zope 2.1.6 on WinNT and W2K ___ Zope maillist - [EMAIL PROTECTED] 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 )