[Zope] Testing for NULL values in TinyTable

Itai Tavor itavor@vic.bigpond.net.au
Thu, 3 Jun 1999 22:55:58 +0900


>Are you doing <!--#var r3--> _before_ the <!--#if r3-->?  Sorry, that's
>probably a silly question for me to ask, but I want to be sure I have my
>bases covered.

Always good to have your bases covered. I tried the #if first, and even the
#if on its own, and even that triggers the error. I also tried <!--#var r3
null=' '-->, no help.

>I have had a similar sounding problem working with an Access database
>connected to Zope using the ZODBC connector.  The problem seems to have gone
>away after I started using the following test:
>   <!--#if name="_vars['sql-var-name']"-->
>        [Do something here]
>   <!--#/if--->

This doesn't do anything for me... maybe the _vars thing is ZODBC specific?

>It looks like you are doing almost the exact same thing, except you aren't
>as explicit as I am being in my #if statement.  My hunch is that difference
>is important.  <!--#if sql-var-name--> just checks to see if sql-var-name
>exists, which it does since your ZSQL method defined it in accessing your
>DB.  Doing <!--#if "sql-var-name"--> checks the _value_ of sql-var-name,
>which is probably what you really what.

Same result with <!--#if r3--> and <!--#if "r3"-->

>I'm new to the game so you should to take anything I say with a bit more
>than a grain of salt.  That said I hope this is of some use to you,
>
>Zope on brave comrade!
>John Miller

Thanks, but I'm still stuck.

>> -----Original Message-----
>> From:	Itai Tavor [SMTP:itavor@vic.bigpond.net.au]
>> Sent:	Thursday, June 03, 1999 5:43 AM
>> To:	zope@zope.org
>> Subject:	[Zope] Testing for NULL values in TinyTable
>>
>> Hi,
>>
>> I have a problem accessing TinyTable cells having NULL values.
>>
>> In the following table:
>>
>> Columns: name r1 r2 r3
>>
>> Data:
>> aaa, 1, 2, 3
>> bbb, 1, 2, NULL (the NULL is added by TinyTable when no value is specified
>> for a cell)
>>
>> When iterating over the table rows:
>>
>> <!--#in table-->
>>
>> Each cell is added to the namespace, so I can access it with <!--#var
>> name-->, or <!--#var r1-->
>>
>> The problem is that I can't deal with r3 in the 2nd row. Everything I try
>> to do with it (like <!--#var r3-->, <!--#if r3-->) ends in a "You are not
>> authorized to access r3" error!
>>
>> Any ideas?
>>
>> Thanks,
>> Itai Tavor
>> --
>> Itai Tavor                      -- "Je sautille, donc je suis."    --
>> itavor@vic.bigpond.net.au       --               - Kermit the Frog --
>> -- "What he needs now is understanding... and a confederate victory" --
>> -- Dr. Jacobi, Twin Peaks         --
>>
>>
>> _______________________________________________
>> Zope maillist  -  Zope@zope.org
>> http://www.zope.org/mailman/listinfo/zope
>>
>> (For developer-specific issues, use the companion list,
>> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )

--
Itai Tavor                      -- "Je sautille, donc je suis."    --
itavor@vic.bigpond.net.au       --               - Kermit the Frog --
-- "What he needs now is understanding... and a confederate victory" --
-- Dr. Jacobi, Twin Peaks         --