[Zope-DB] zsql question

Jim Abramson jabramson at wgen.net
Thu Oct 7 14:06:50 EDT 2004


That should pretty much do it.

If you want to go even further, you could write a python script to make
sure the IP address is valid and make that your if condition:

<dtml-if "validIpAddress(ipAddress)">insert...

You could dtml-raise if the ip was _not_ valid (I _think_ that would
work in a sqlmethod...)

Jim

> -----Original Message-----
> From: Laura McCord [mailto:Laura.McCord at doucet-austin.com] 
> Sent: Thursday, October 07, 2004 1:05 PM
> To: zope-db at zope.org
> Subject: [Zope-DB] zsql question
> 
> I am trying to do an insert but I do not want the insert to 
> occur if the value of "ipAddress" was not entered in the form.
> 
> So far I have this:
> 
> insert into NetInt(IPAddress, SystemNetName) Values( 
> '<dtml-var name="ipAddress" sql_quote>', '<dtml-var 
> name="HostName" sql_quote>'
> )
> 
> I am thinking that I have to put a conditional statement such 
> as <dtml-if ipAddress>  insert into NetInt(IPAddress, 
> SystemNetName) Values( '<dtml-var name="ipAddress" 
> sql_quote>', '<dtml-var name="HostName" sql_quote>'
> )
> </dtml-if>
> 
> Any suggestions?
> 
> Thanks,
>  Laura
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
> 


More information about the Zope-DB mailing list