[Zope] Testing for duplicate ZODB records

Michael mlewis@exasource.com
Mon, 06 May 2002 09:14:27 -0600


I've looked through the "Zope Book","Web Application Development and 
Content Management", the Zope How to's and every source I can think of 
and still can't seem to find how to test for duplicate records in ZODB. 
  As it is right now, I can enter 100 records that are exactly the same, 
except for their id number.  Can anyone point me to a resource that 
explains how to do this??

I'm using a form to gather the data to be entered, then it calls a 
record processor that sets the values and creates the record.ie:

----------------------------------------------------------------

form name="some_form" action="record_processor"
input type="text" name="user_fname" value=""
input type="text" name="user_lname" value=""
input type="text" name="user_email" value=""
input type="submit" name="submit" value="Submit"

----------------------------------------------------------------

(record_processor)

<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('title', user_lname+' - '+user_fname+' 
-'+user_email)">

<dtml-with "manage_addProduct['UserInfo']">
<dtml-call "user_info_entry_add(_.None, _, NoRedir=1)">
</dtml-with>
            <dtml-var nice_little_acknowledgement_message>

Thanks,

Michael