Hmm - with regard calling ZSQL method from PythonMethod, this works:
def pythonmethod(self):
a = []
for v in self.SQL_list_something():
a.append(v.field)
return a
dtml-var pythonmethod
*But* of course I can't pass "self" over XMLRPC. Why does self.ZSQL_method()
work, but:
def pythonmethod(meth):
a = []
for v in meth():
a.append(v.field)
return a
dtml-var "pythonmethod(ZSQL_method)"
Give "__call__ not defined"?
Regards,
Phil
+--+
| Phil Mayers, Network Support |
| Centre for Computing Services|
| Imperial College |
+--+
-Original Message-
From: Mayers, Philip J [mailto:[EMAIL PROTECTED]]
Sent: 18 January 2001 22:37
To: '[EMAIL PROTECTED]'
Subject: [Zope] ZSQL, Python methods and XMLRPC
I've three questions (but I'm making progress!):
1) In 2.2.5, how can I call a ZSQL method from a Python Method - I'm passing
the method in as a parameter, and the furthest I get says "__call__ not
defined".
Do PythonScripts obivate the need for this? I assume I can just do this:
for record in context.folder.subfolder.SQL_method(val1='a',val2='b'):
# do stuff
Does that work?
2) When calling a DTML method over XMLRPC, dtml-in
"SQL_method(username=AUTHENTICATED_USER)" doesn't work, but dtml-in
"SQL_method(username=REQUEST.AUTHENTICATED_USER)" does. Why?
3) Why aren't record values (the return of an SQL method) marshallable over
XMLRPC. I get this:
cannot marshal extension class ExtensionClass at 70356ff4 objects
Regards,
Phil
___
Zope maillist - [EMAIL PROTECTED]
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 )
___
Zope maillist - [EMAIL PROTECTED]
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 )