On Mon, 29 May 2000, Kyler B. Laird wrote:

> This is not the same functionality as is provided
> by the "optional" attribute.  How would I use it
> with an integer, for example?  I don't want a
> default value; I want the option of not having
> the value set at all.
> 
> I like the optional attribute.  I'd like to see
> it do more than sit idle in the code.

You don't have to do the typechecking in the 'arguments' box if you don't
want. eg. in your arguments section:

course=""
subject=""

And your method:

select * from enrolments
<dtml-sqlgroup where>
    <dtml-sqltest course type=int optional>
    <dtml-sqltest subject type=nb optional>
</dtml-sqlgroup>

The definition of the 'optional' tag from the docs might help here:
    '''A flag indicating if the test is optional. If the test is optional
    and no value is provided for a variable, or the value provided is
    an invalid empty string, then no text is inserted'''

Hmm... looking at this definition, it seems you have found a bug
(but setting the default value to "" in the arguments section will
provide a workaround). Or maybe 'no value provided' means 'is None'.
Anyone from DC want to provide a ruling? :-)

-- 
Stuart Bishop                          Work: [EMAIL PROTECTED]
Senior Systems Alchemist               Play: [EMAIL PROTECTED]
Computer Science, RMIT University


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to