Re: [Zope-dev] Zope Book Question: 'context' doesn't work in PythonMethods

2000-11-20 Thread Shane Hathaway

Chris Gray wrote:
> 
> I tried following one of the Zope Book examples to no avail.
> 
> >From the scripting chapter:
> 
> "Since Python Methods are bound the Zope objects, you can get access to Zope
> objects via the context parameter. For example, this methods returns the
> number of objects contained by a given Zope object:
> 
> Method id: numberOfObjects
> Parameters:
> 
> return len(context.objectIds())"
> 
> I just get a Name Error on context and if I add context as a parameter I
> just get told that the parameter was omitted from the request.  This works,
> however:
> 
> Method id: numberOfObjects
> Parameters: self
> 
> return len(self.objectIds())
> 
> Am I missing something?  Is this because Amos and Michel seem to be using
> 2.2.3 and I'm using 2.2.2?

They are using an unreleased version of the Python Methods product. 
AFAIK the only thing holding up the release of the new Python Methods is
the renaming.

Shane

___
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 )




Re: [Zope-dev] Zope Book Question: 'context' doesn't work in PythonMethods

2000-11-20 Thread Ken Manheimer

On Mon, 20 Nov 2000, Shane Hathaway wrote:

> They are using an unreleased version of the Python Methods product. 
> AFAIK the only thing holding up the release of the new Python Methods is
> the renaming.

(I believe the version in question is available from the public CVS
repository, as the Products/DC/PythonMethod module.)

(Ken)
[EMAIL PROTECTED]


___
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 )




[Zope-dev] Zope Book Question: 'context' doesn't work in PythonMethods

2000-11-20 Thread Chris Gray

I tried following one of the Zope Book examples to no avail.

>From the scripting chapter:

"Since Python Methods are bound the Zope objects, you can get access to Zope
objects via the context parameter. For example, this methods returns the
number of objects contained by a given Zope object:

Method id: numberOfObjects
Parameters:

return len(context.objectIds())"

I just get a Name Error on context and if I add context as a parameter I
just get told that the parameter was omitted from the request.  This works,
however:

Method id: numberOfObjects
Parameters: self

return len(self.objectIds())

Am I missing something?  Is this because Amos and Michel seem to be using
2.2.3 and I'm using 2.2.2?

adTHANKSvance
Chris


___
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 )