[Zope-DB] How do I trim white space before inserting into database

Jeffrey Turmelle jefft@iri.columbia.edu
04 Apr 2002 18:27:59 -0500

This is probably very simple, but I am VERY new to Zope & Python!

I have a form, which calls a DTML Method for inserting names into a

In the following DTML-METHOD
  checkUniqueName does a select to find out if the name already exists
  insertName inserts the name into the database.

I know that this is where I need to use strip() to strip the whitespace
for the variables (first, last, ...) but how exactly do I do this?


<dtml-in checkUniqueName>
    <p class=byline>The following users currently exist with the name
<dtml-var last>, <dtml-var first>:<br>

    <dtml-if sequence-start>
   </dtml-if sequence-start>
        <td><dtml-var first></td>
        <td><dtml-var middle></td>
        <td><dtml-var last></td>
    <dtml-if sequence-end>

    <dtml-call insertName>
    <h3><dtml-var first> <dtml-var last> was created</h3>


Thanks in advance for any guidance,


Jeffrey Turmelle                       jefft@iri.columbia.edu
IRI - International Research Institute for Climate Prediction
207 Monell   -    61 Route 9W    -    Palisades, NY 10964 USA
Phone: 845.680.4529                         Fax: 845.680.4864