Re: [Zope3-dev] Re: adapter registration question

2006-11-16 Thread Chris Withers
Philipp von Weitershausen wrote: Not sure what official terminology glossary you're basing this on, but we often refer to IZopeDublinCore(myobj) as the IZopeDublinCore adapter of myobj. Whatever is called to instantiate that object we call the adapter factory or adapter implementation. The

Re: [Zope3-dev] Re: adapter registration question

2006-11-16 Thread Chris Withers
Philipp von Weitershausen wrote: IZopeDublinCore(obj) is a flexible version of ZDCAnnotatableAdapter(obj) Flexible, because a different implementation that ZDCAnnotatableAdapter might be used. That's dispatched through the adapter registry. Right, exactly. IZopeDublinCore(myobj)

Re: [Zope3-dev] Re: adapter registration question

2006-11-16 Thread Chris Withers
Jean-Marc Orliaguet wrote: once you have that utility / adapter you should be able to call it like: converter = getAdapterFor(123, type=IToStringConverter) strResult = converter.convert(123) Not quite, what I'm looking to do is more along the lines of: mystr = getAdapter(123,str) (where

[Zope3-dev] adapter registration - sort of works :-S

2006-11-16 Thread Chris Withers
Hi All, Chris Withers wrote: Jean-Marc Orliaguet wrote: once you have that utility / adapter you should be able to call it like: converter = getAdapterFor(123, type=IToStringConverter) strResult = converter.convert(123) Not quite, what I'm looking to do is more along the lines of:

[Zope3-dev] Re: adapter registration - sort of works :-S

2006-11-16 Thread Philipp von Weitershausen
Chris Withers wrote: Chris Withers wrote: Jean-Marc Orliaguet wrote: once you have that utility / adapter you should be able to call it like: converter = getAdapterFor(123, type=IToStringConverter) strResult = converter.convert(123) Not quite, what I'm looking to do is more along the

Re: [Zope3-dev] Re: adapter registration question

2006-11-16 Thread Philipp von Weitershausen
Chris Withers wrote: Philipp von Weitershausen wrote: Not sure what official terminology glossary you're basing this on, but we often refer to IZopeDublinCore(myobj) as the IZopeDublinCore adapter of myobj. Whatever is called to instantiate that object we call the adapter factory or adapter

Re: [Zope3-dev] Re: adapter registration - sort of works :-S

2006-11-16 Thread Chris Withers
Philipp von Weitershausen wrote: from zope.component import provideAdapter provideAdapter(str,(int,),str) from zope.component import getAdapter getAdapter(123,str) '123' Yay! That's _exactly_ what I want. And that's exactly what I meant -- and wrote about half way up the thread. :)

Re: [Zope3-dev] Re: adapter registration - sort of works :-S

2006-11-16 Thread Philipp von Weitershausen
Chris Withers wrote: provideAdapter(to_date,(str,int),DateTime) This registers a multi adapter for (a_string, an_integer), like views are multi-adapters for (context, request). You want to say: provideAdapter(to_date, (str,), DateTime) provideAdapter(to_date, (int,), DateTime)

[Zope3-dev] Re: adapter registration - sort of works :-S

2006-11-16 Thread Jean-Marc Orliaguet
Philipp von Weitershausen wrote: Chris Withers wrote: Chris Withers wrote: Jean-Marc Orliaguet wrote: once you have that utility / adapter you should be able to call it like: converter = getAdapterFor(123, type=IToStringConverter) strResult = converter.convert(123) Not quite, what I'm

[Zope3-dev] wading through zcml...

2006-11-16 Thread Chris Withers
What's the difference between zope:view, browser:view, browser:page and browser:viewlet? I'm trying to register an adapter in such a way that I can do the following in a page template: p tal:content=structure someobj/@@render/ Which of the myriad flavours of view registration should I be

Re: [Zope3-dev] wading through zcml...

2006-11-16 Thread Martin Aspeli
Chris Withers wrote: What's the difference between zope:view, browser:view, browser:page and browser:viewlet? I would strongly encourage you to buy Philipp's book when the second edition comes out, and read some of the available existing documents (e.g. worldcookery.com, the Zope 3 wiki

Re: [Zope3-dev] wading through zcml...

2006-11-16 Thread Chris Withers
Martin Aspeli wrote: Chris Withers wrote: What's the difference between zope:view, browser:view, browser:page and browser:viewlet? I would strongly encourage you to buy Philipp's book when the second edition comes out, and read some of the available existing documents (e.g.

[Zope3-dev] Re: wading through zcml...

2006-11-16 Thread Philipp von Weitershausen
Chris Withers wrote: What's the difference between zope:view, browser:view, browser:page and browser:viewlet? It's a mess. Here's the gist: zope:adapter Registers an adapter and optionally applies a permission to the interface that you're adapting to, e.g.:: adapter

Re: [Zope3-dev] Re: adapter registration - sort of works :-S

2006-11-16 Thread Paul Winkler
On Thu, Nov 16, 2006 at 10:21:09AM +0100, Philipp von Weitershausen wrote: How would I _really_ return None from an adapter? You don't. You call the adaption with a default value (e.g. None) to cover for the coudln't adapt case: getAdapter('moo', DateTime, None) That doesn't work,

Re: [Zope3-dev] Bugday today

2006-11-16 Thread Jeff Shell
On 11/15/06, Christian Theune [EMAIL PROTECTED] wrote: Hi, just a quick reminder: Today is a bugday to help get Zope 3.3 virtually free of bugs (by handling bugs from the collector.) Any status report on this? The collector state(s) seem unchanged. -- Jeff Shell

Re: [Zope3-dev] Bugday today

2006-11-16 Thread Fred Drake
On 11/16/06, Jeff Shell [EMAIL PROTECTED] wrote: Any status report on this? The collector state(s) seem unchanged. The collector is software. For some reason, it doesn't seem to want to work for me at least. It's possible that this capriciousness on the part of the collector isn't just aimed

Re: [Zope3-dev] Re: adapter registration question

2006-11-16 Thread Dieter Maurer
Philipp von Weitershausen wrote at 2006-11-15 21:11 +0100: ... Not sure what official terminology glossary you're basing this on I am basing this on the meaning of english words. An adapter is something that adapts (and not something that is adapted). adapt is a transitive verb. It applies to

Re: [Zope3-dev] Re: adapter registration question

2006-11-16 Thread Dieter Maurer
Jean-Marc Orliaguet wrote at 2006-11-15 20:51 +0100: ... but what problem is all this supposed to solve? are you guys writing a PhD or something .-) ? Well chosen terminology is a key to understanding. Therefore, it is justified to discuss about it. -- Dieter

Re: [Zope3-dev] Bugday today

2006-11-16 Thread Christian Theune
Hi, Fred Drake wrote: On 11/16/06, Jeff Shell [EMAIL PROTECTED] wrote: Any status report on this? The collector state(s) seem unchanged. The collector is software. For some reason, it doesn't seem to want to work for me at least. It's possible that this capriciousness on the part of the

[Zope3-dev] Security with Viewlets

2006-11-16 Thread Paul Carduner
Hi, I am having trouble debugging viewlets that redirect to Unauthorized pages. Here is the synopsis. We have a dashboard page with a bunch of viewlets displaying information about all different parts of the system. When one viewlet tries to access forbidden attributes, the whole page gets

Re: [Zope3-dev] Re: wading through zcml...

2006-11-16 Thread Shane Hathaway
Philipp von Weitershausen wrote: browser:view Like zope:view, except: * the request type (second adapted object) defaults to IBrowserDefaultLayer * the permission always applies to 'publishTraverse', 'browserDefault' and '__call__' attributes, in addition to the

Re: [Zope3-dev] Security with Viewlets

2006-11-16 Thread Shane Hathaway
Paul Carduner wrote: I am having trouble debugging viewlets that redirect to Unauthorized pages. Here is the synopsis. We have a dashboard page with a bunch of viewlets displaying information about all different parts of the system. When one viewlet tries to access forbidden attributes, the

Re: [Zope3-dev] Re: wading through zcml...

2006-11-16 Thread Shane Hathaway
Philipp von Weitershausen wrote: Shane Hathaway wrote: Philipp von Weitershausen wrote: browser:view Like zope:view, except: * the request type (second adapted object) defaults to IBrowserDefaultLayer * the permission always applies to 'publishTraverse',

[Zope3-dev] Can an adapter find out what name it was registered for?

2006-11-16 Thread Chris Withers
Hi All, Can a named adapter find out the name it was registered with during the adaptation process? This is the only way I can think to do it, but results in the thing calling methods on the adapter passing in the name to every method call to get the information across, which seems a bit

Re: [Zope3-dev] Re: wading through zcml...

2006-11-16 Thread Philipp von Weitershausen
Shane Hathaway wrote: Philipp von Weitershausen wrote: Shane Hathaway wrote: Philipp von Weitershausen wrote: browser:view Like zope:view, except: * the request type (second adapted object) defaults to IBrowserDefaultLayer * the permission always applies to

[Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-16 Thread Philipp von Weitershausen
Chris Withers wrote: Can a named adapter find out the name it was registered with during the adaptation process? Nope. -- http://worldcookery.com -- Professional Zope documentation and training ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub:

[Zope3-dev] Re: strange behavior of intid-utility

2006-11-16 Thread Philipp von Weitershausen
Tom Gross wrote: the presence of a intid-utility gives a strange behavior when adding other objects to a zope3 container. (test attached) What's the error/failure? Please be more specific as to what the actual problem is. -- http://worldcookery.com -- Professional Zope documentation

[Zope3-dev] Re: Can an adapter find out what name it was registered for?

2006-11-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philipp von Weitershausen wrote: Chris Withers wrote: Can a named adapter find out the name it was registered with during the adaptation process? Nope. But you can create the adapter factories in such a way that they know that name, via a

[Zope3-dev] Re: adapter registration question

2006-11-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Withers wrote: Philipp von Weitershausen wrote: IZopeDublinCore(obj) is a flexible version of ZDCAnnotatableAdapter(obj) Flexible, because a different implementation that ZDCAnnotatableAdapter might be used. That's dispatched

Re: [Zope3-dev] Re: wading through zcml...

2006-11-16 Thread Shane Hathaway
Philipp von Weitershausen wrote: Shane Hathaway wrote: However, I'm wondering what browser:page does to make something publishable, that browser:view doesn't do. It creates a new class with an extra mix-in class that has a browserDefault method which in turn points to the template, method or

[Zope3-dev] Re: wading through zcml...

2006-11-16 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shane Hathaway wrote: Philipp von Weitershausen wrote: Shane Hathaway wrote: However, I'm wondering what browser:page does to make something publishable, that browser:view doesn't do. It creates a new class with an extra mix-in class that has a