[ZPatterns] Why is class_default_for_ method unbound?

Itai Tavor [email protected]
Tue, 21 Aug 2001 12:10:30 +1000


--============_-1213762655==_ma============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"

I got the following DataSkin class (Zope 2.3.2, ZPatterns 0.4.3p1):

class MyClass(DataSkin):

      def class_default_for_method1(self, REQUEST):
         """ Display something """
         ...

Calling http://mysite/myinstance/method1 returns:

Error Type: TypeError
Error Value: unbound Python method must be called with MyClass 1st argument

Why is method1 unbound? Why does it behave any different than a 
method defined as def method1(self, REQUEST)? And what do I do to 
make this method work?
-- 
--
Itai Tavor                      -- "Je sautille, donc je suis."    --
[email protected]            --               - Kermit the Frog --
--                                                                 --
-- "If you haven't got your health, you haven't got anything"      --

--============_-1213762655==_ma============
Content-Type: text/html; charset="us-ascii"

<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Why is class_default_for_ method
unbound?</title></head><body>
<div>I got the following DataSkin class (Zope 2.3.2, ZPatterns
0.4.3p1):</div>
<div><br></div>
<div>class MyClass(DataSkin):</div>
<div><br></div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; def class_default_for_method1(self,
REQUEST):</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;
Display something &quot;&quot;&quot;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...</div>
<div><br></div>
<div>Calling http://mysite/myinstance/method1 returns:</div>
<div><br></div>
<div>Error Type: TypeError</div>
<div>Error Value: unbound Python method must be called with MyClass
1st argument</div>
<div><br></div>
<div>Why is method1 unbound? Why does it behave any different than a
method defined as def method1(self, REQUEST)? And what do I do to make
this method work?</div>
<x-sigsep><pre>-- 
</pre></x-sigsep>
<div>--<br>
Itai
Tavor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-- &quot;Je sautille, donc je suis.&quot;&nbsp;&nbsp;&nbsp; --<br>
[email protected]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp;
--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp; - Kermit the Frog --<br>
--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span
></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --<br>
-- &quot;If you haven't got your health, you haven't got
anything&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --<br>
</div>
</body>
</html>
--============_-1213762655==_ma============--