Re: [Zope] Critical Question for Dieter - Testing with <dtml-in Catalog>
-----Original Message----- From: Michael <mlewis@exasource.com> To: kedai@kedai.com.my <kedai@kedai.com.my> Cc: zope@zope.org <zope@zope.org>; Dieter Maurer <dieter@handshake.de>; paul@zope.com <paul@zope.com> Date: Wednesday, May 15, 2002 7:12 PM Subject: Re: [Zope] Critical Question for Dieter - Testing with <dtml-in Catalog>
Man, it must have been a lot of head bangin. Now can I use this same method for let's say limiting the number of postings someone could make? For example, say I have a variable called max_limit. max_limit=10, could I do <dtml-if "Catalog(max_limit<={'query':_['sequence-number']})"> Sometimes this syntax issue gets rather confusing.
Thanks again,
Michael
well, it's not a matter of plugging in stuff. depends on what you want to do, really. if you have max_limit in the catalog too, sure that syntax is used to query the catalog. check the zopebook hth
Bakhtiar, When I tried this initially, (I've been up for about 36 hours), I used: <dtml-in Catalog> <dtml-if "Catalog(username={'query'_['username']})"> <dtml-call "RESPONSE.redirect('duplicate_record')"> </dtml-if> </dtml-in> <dtml-call "REQUEST.set('username',username)"> <dtml-with "manage_addProduct['CandidateInfo']"> <dtml-call "candidate_info_entry_add(_.None, _, NoRedir=1)"> </dtml-with> When I tried to enter a duplicate it redirected me and when I entered a unique address, it entered it. Then I noticed that even though I was redirected, it still entered the information because of the way I structured the test. When I re-did it as follows: <dtml-in Catalog> <dtml-if "Catalog(username={'query'_['username']})"> <dtml-call "RESPONSE.redirect('duplicate_record')"> <dtml-else> <dtml-call "REQUEST.set('username',username)"> <dtml-with "manage_addProduct['CandidateInfo']"> <dtml-call "candidate_info_entry_add(_.None, _, NoRedir=1)"> </dtml-with> </dtml-if> </dtml-in> It will still redirect me, but when I enter a unique address, it does not enter the record, but gives the message that it has. Sorry about that. Michael
participants (2)
-
Bak @ kedai -
Michael