[Zope] csv import continued

Roché Compaan roche at upfrontsystems.co.za
Mon Aug 9 10:00:58 EDT 2004


* Les Ferguson <lhf at xtra.co.nz> [2004-08-09 10:39]:
> Dieter Maurer wrote:
> >Z SQL methods expect their parameters either as keyword
> >parameters or in the REQUEST object.
> >
> >It has been written dozens of times...
> 
> Or as a single mapping object, according to the Z SQL method help.
> 
> Are there any hidden complications to that?  And can anybody give a 
> simple example of using that format?
> 
> I have been struggling with passing a record into a Z SQL method too.

If a ZSQL method has "one", "two" and "three" as arguments it can be
called (a) with a single mapping object:

        d = {'one': 1, 'two': 2, 'three': 3'}
        some_zsql_method(d)

        NOTE: this is the same as calling the method with the REQUEST

        some_zsql_method(REQUEST)

(b) or with keyword arguments:

        some_zsql_method(one=one, two=two, three=three)

(c) or with no arguments in which case the method will try to acquire
the values for all arguments:

        some_zsql_method()


-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za


More information about the Zope mailing list