[Zope] How does dtml-sqlgroup really work?

Jorge O. Martinez jmartinez@eMediaMillWorks.com
Sat, 08 Jun 2002 13:04:34 -0400


Hi:

I can see that now. That's unfortunate, sqltest would be a lot more useful if 
it was 'smart enough' to do nothing if the var is not set or does not exist 
(the power of dtml-if + the power of sqltest combined I guess).

Thanks for your feedback

Regards,

Jorge M.

Oliver Bleutgen wrote:
> Jorge O. Martinez wrote:
> 
>> Hi all:
>>
>> Thanks for your help. In the end I had to use this ugly thing, but it 
>> works, slightly dissapointed I could not get sqltest & sqlgroup to 
>> work....maybe I'll have to time to dig deeper later, and understand it 
>> better when I increase my Zope Zen ;-). Thanks!
> 
> 
> Jorge,
> 
> IIRC it's right that sqltest needs the existence of the variable you 
> test for (it's not like <dtml-if variable_name>).
> But you can set (create) the variables you test for easily at the 
> arguments field of the ZSQL method (don't remember it's exact name 
> although I stared at one for some time today). Anyway, there's a text 
> field at the edit-tab of a ZSQL-method where you can define the 
> variables it expects - look at the relevant docs.
> So, there you can write something like (again IIRC)
> my_variable:string=''
> which sets my_variable to '' if it isn't in the namespace and didn't get 
> passed.
> If you use that for all you variables, <dtml-sqltest bla> will work as 
> expected (since '' == false).
> 
> 
> cheers,
> oliver
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
> 



-- 
Jorge O. Martinez
MIS Senior Associate
eMediaMillWorks
1100 Mercantile Lane, Suite 119
Largo, MD 20774
E-mail  => jmartinez@eMediaMillWorks.com
Phone   => (301)883-2482 ext. 105
Fax     => (301)883-9754