This weekend I did some work on python scripts and found some things which
suprised me, can someone enlighten me on this why these 'strange' things are
needed? :

1. When calling a method from a python script you've to do this :

    (assume x is the value to pass  and name is a parameter of mymethod)


   The following doesn't works :

     context.mymethod(x) (this gives an error)


2. Assume you've an sqlmethod which expects 2 parametes, but one is optional

    select *
    from invoice
    <dtml-sqlgroup where required>
                <dtml-sqltest customersid column=customers_id op=eq
                 <dtml-sqltest productsid column=products_id op=eq type=int

   So, you could run this sql with or without the productsid

  No, calling from python script doesn't works since it

  expects: context.mymethod(customerid=..., productsid=...)

  while context.mymethod(customerid=...) doesn't work..

Now, this implies that I've to write 2 sqlmethods (one with 2 parameters and
one with 1),
which is pretty stupid, since sqlmethods perfect allow to ignore a parameter
when not passed...

Can somebody tell me more on this? Why this is the case and perhaps a
solution for (2)

Thanks in advance,

Tom Deprez

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

Reply via email to