[Zope-DB] zsql question

Anthony Molinaro amolinaro at wgen.net
Thu Oct 7 14:51:03 EDT 2004


Very nice mr.Abramson, I like your style...

-----Original Message-----
From: Jim Abramson 
Sent: Thursday, October 07, 2004 2:07 PM
To: Laura McCord
Cc: zope-db at zope.org
Subject: RE: [Zope-DB] zsql question


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
> 
_______________________________________________
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