[Zope] Critical Question for Dieter - Testing with <dtml-in Catalog>

Michael mlewis@exasource.com
Tue, 14 May 2002 23:54:08 -0600


First of all, I want to thank you for all of your help in the past. 
Every question of mine you have responded to has been right on target. I 
am trying to put up a site, was counting on Zope as a solution, am out 
of money, behind schedule, have posted this question before and got no 
response, can not find any documentation, and do not have the money to 
hire Zope Corp consultants to help fix it.  I'm mortgagedto the hilt, 
and if I can't find a solution, I'm history.

I have a new account form which can be filled out on line.  I'm 
auto-generating a unique id in my product class by :

<dtml-call "REQUEST.set('ts', ZopeTime())">
<dtml-call "REQUEST.set('id',_.str(_.int(ts)))">
<dtml-with "candidate_info_entry.createInObjectManager(REQUEST['id'], 
REQUEST)">  ---(from the web tutorial)

I'm trying to keep people from entering some of the same information 
twice such as email address.  (I am using their email address as their 
username for login, since it is unique)

I need to be able to test the Catalog to see if the username is already 
indexed, and if so, raise a message that that username is already on file.

I've tried :
<dtml-in Catalog>
<dtml-if "_['username'] == _['sequence-item']">
<dtml-call "RESPONSE.redirect('/duplicate_record')">
<dtml-else>
<dtml-call "REQUEST.set('username', username)">
<dtml-call "REQUEST.set('password', password)">
<dtml-call "REQUEST.set('password_confirm', password_confirm)">
<dtml-call "REQUEST.set('user_hint', user_hint)">
<dtml-call "REQUEST.set('user_fname', user_fname)">
<dtml-call "REQUEST.set('user_lname', user_lname)">
<dtml-call "REQUEST.set('user_email', user_email)">
<dtml-call "REQUEST.set('user_city', user_city)">
<dtml-call "REQUEST.set('user_state', user_state)">
<dtml-call "REQUEST.set('user_province', user_province)">
<dtml-call "REQUEST.set('user_country', user_country)">

<dtml-call "REQUEST.set('title', user_fname+' - '+user_lname+' 
-'+user_email)">

<dtml-with "manage_addProduct['CandidateInfo']">
<dtml-call "candidate_info_entry_add(_.None, _, NoRedir=1)">
</dtml-with>

I've tried many other possibilitiesas well, but it just blows past and 
enters the record anyway.

I also tried setting the email address as the id and then do a "try and 
except", but that doesn't work either

Do you know a possible solution to this, or where I could find some 
documentation on it?  I'm desperate.

Thanks in Advance,

Michael