[Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Chris Withers
Hi All, I find myself often having to define pure marker interfaces for each class that I define, purely so I can register adapters for objects of that class. How do people feel about: - being able to register an adapter as follows: adapter for=.myclasses.MyClass

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Lennart Regebro
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote: I'm expecting people to say NO! very loudly, but I'm interested in the real reasons for why this is bad. Well it removes the possibility of switching out the class, which begs the question why you would have an adapter in the first place.

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Lennart Regebro
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote: It's not one to one: adapter for=.myclasses.MyClassA provides=.interfaces.ISomething factory=.adapters.MyAdapter1 / adapter for=.myclasses.MyClassB provides=.interfaces.ISomething factory=.adapters.MyAdapter1

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Lennart Regebro
Sorry about the premature sending, I don't know what button I pressed... Here we go again: So instead of making a marker interface, which is two lines of code, and two registrations, a total of six lines (with the imports), you have an extra ZCML registration statement, which is three lines of

[Zope3-dev] Re: adaptation based on class rather than interface

2006-11-09 Thread Rocky Burt
On Thu, 2006-09-11 at 11:13 +, Chris Withers wrote: I find myself often having to define pure marker interfaces for each class that I define, purely so I can register adapters for objects of that class. I do this frequently when I want to adapt classes I have no control over (such as in

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Lennart Regebro
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote: Why do you say extra ZCML registration? You need that ZCML registration whether or not you have to write the marker interface... Sure, but with the marker interface you need only one. You need one for each class, in your example, thats two. So

Re: [Zope3-dev] Opaque error, help

2006-11-09 Thread Christian Theune
Hi, Shane Hathaway wrote: I'm working on enhancing zope.app.apidoc, but I ran into an exception that's hard to decipher. I've attached the traceback. I don't know which __init__() it's complaining about, and I don't know how to find out. What can I do to find out which __init__() the

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Jim Fulton
Chris Withers wrote: Hi All, I find myself often having to define pure marker interfaces for each class that I define, purely so I can register adapters for objects of that class. How do people feel about: - being able to register an adapter as follows: adapter for=.myclasses.MyClass

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Chris Withers
Jim Fulton wrote: adapter for=.myclasses.MyClass provides=.interfaces.ISomething factory=.adapters.MyAdapter / I think it is a fine idea. That's why it has been supported for a long time. You can register adapters and views (which, of course are adapters) for classes as well

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Martijn Faassen
Martin Aspeli wrote: Chris Withers wrote: I find myself often having to define pure marker interfaces for each class that I define, purely so I can register adapters for objects of that class. Why does your class not have a (non-marker) interface in the first place? The use of interfaces as

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Martijn Faassen
Chris Withers wrote: Jim Fulton wrote: adapter for=.myclasses.MyClass provides=.interfaces.ISomething factory=.adapters.MyAdapter / I think it is a fine idea. That's why it has been supported for a long time. You can register adapters and views (which, of course are

Re: [Zope3-dev] Zope 3.3.1 release

2006-11-09 Thread Martijn Faassen
Christian Theune wrote: originally we intended to do a Zope 3.3.1 release in November to get virtually bug free. I didn't see any momentum on this. How about a bug day? I'm supposed to be the release manager for this too. I was hoping someone else would volunteer but of course I already

Re: [Zope3-dev] Opaque error, help

2006-11-09 Thread Shane Hathaway
Christian Theune wrote: Shane Hathaway wrote: I'm working on enhancing zope.app.apidoc, but I ran into an exception that's hard to decipher. I've attached the traceback. I don't know which __init__() it's complaining about, and I don't know how to find out. What can I do to find out which

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Shane Hathaway
Chris Withers wrote: Jim Fulton wrote: adapter for=.myclasses.MyClass provides=.interfaces.ISomething factory=.adapters.MyAdapter / I think it is a fine idea. That's why it has been supported for a long time. You can register adapters and views (which, of course are

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Stephan Richter
On Thursday 09 November 2006 10:02, Chris Withers wrote: ...will work, right? import zope.component class A(object): ... pass ... class B(A): ... pass ... import zope.interface class ISomething(zope.interface.Interface): ... pass ... class BToSomething(object): ... def

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Jean-Marc Orliaguet
Lennart Regebro wrote: On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote: Why do you say extra ZCML registration? You need that ZCML registration whether or not you have to write the marker interface... Sure, but with the marker interface you need only one. You need one for each class, in

Re: [Zope3-dev] Opaque error, help

2006-11-09 Thread Christian Theune
Shane Hathaway wrote: Christian Theune wrote: Shane Hathaway wrote: I'm working on enhancing zope.app.apidoc, but I ran into an exception that's hard to decipher. I've attached the traceback. I don't know which __init__() it's complaining about, and I don't know how to find out. What

[Zope3-dev] Zope 3.4 sprint at PyCon 2007

2006-11-09 Thread Christian Theune
Hi, I'll be around at PyCon 2007 and I plan to have a Zope 3.4 sprint there. I've added a wiki page to the PyCon 2007 wiki and everybody is invited to join me: http://us.pycon.org/TX2007/Zope34Sprint Cheers, Christian -- gocept gmbh co. kg - forsterstraße 29 - 06112 halle/saale - germany

[Zope3-dev] Re: adaptation based on class rather than interface

2006-11-09 Thread Martin Aspeli
Jean-Marc Orliaguet wrote: And there is nothing wrong with using inheritance when there is a '__IS A __' type of relation (e.g. an ordered folder IS A folder IS AN item, ...), or if there is a HAS_A type of relation (a folder has items, a chair has four legs...). It seems that Zope3 has

Re: [Zope3-dev] Opaque error, help

2006-11-09 Thread Shane Hathaway
Christian Theune wrote: Shane Hathaway wrote: Unfortunately, the adapter hook is in C. It would be great if I could switch it to Python. Is that possible? I remember being able to step into it. pdb then put me into the next Python-level within there ... Probably you can delete some

[Zope3-dev] Re: adaptation based on class rather than interface

2006-11-09 Thread Martin Aspeli
OT: Thunderbird makes a real mess of interpreter examples, thinking the '' is an indent and making it a coloured line. Anyone got an idea how I stop it from doing that? Martin ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub:

Re: [Zope3-dev] adaptation based on class rather than interface

2006-11-09 Thread Dieter Maurer
Martin Aspeli wrote at 2006-11-9 04:37 -0800: ... Why does your class not have a (non-marker) interface in the first place? The use of interfaces as documentation and as formalisms for expressing a class' functionality (in adapters, utilities etc) is one of the benefits that Zope 3 introduces. I

[Zope3-dev] [OT] Python interpreter examples in Thunderbird

2006-11-09 Thread Shane Hathaway
Martin Aspeli wrote: OT: Thunderbird makes a real mess of interpreter examples, thinking the '' is an indent and making it a coloured line. Anyone got an idea how I stop it from doing that? If you find out, PLEASE tell me too. :-) Shane ___

Re: [Zope3-dev] [OT] Python interpreter examples in Thunderbird

2006-11-09 Thread Christian Theune
Shane Hathaway wrote: Martin Aspeli wrote: OT: Thunderbird makes a real mess of interpreter examples, thinking the '' is an indent and making it a coloured line. Anyone got an idea how I stop it from doing that? If you find out, PLEASE tell me too. :-) I think this might help you:

Re: [Zope3-dev] [OT] Python interpreter examples in Thunderbird

2006-11-09 Thread Shane Hathaway
Christian Theune wrote: Shane Hathaway wrote: Martin Aspeli wrote: OT: Thunderbird makes a real mess of interpreter examples, thinking the '' is an indent and making it a coloured line. Anyone got an idea how I stop it from doing that? If you find out, PLEASE tell me too. :-) I think

Re: [Zope3-dev] [OT] Python interpreter examples in Thunderbird

2006-11-09 Thread Christian Theune
Shane Hathaway wrote: Christian Theune wrote: Shane Hathaway wrote: Martin Aspeli wrote: OT: Thunderbird makes a real mess of interpreter examples, thinking the '' is an indent and making it a coloured line. Anyone got an idea how I stop it from doing that? If you find out, PLEASE tell me

[Zope3-dev] Re: [OT] Python interpreter examples in Thunderbird

2006-11-09 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shane Hathaway wrote: Martin Aspeli wrote: OT: Thunderbird makes a real mess of interpreter examples, thinking the '' is an indent and making it a coloured line. Anyone got an idea how I stop it from doing that? If you find out, PLEASE tell me

[Zope3-dev] browser widgets: items widgets and label tags

2006-11-09 Thread yuppie
Hi! I plan to do some bugfixing in zope.formlib and zope.app.form. This is what I'd like to fix first: The HTML label tag is not used correctly with items widgets. The result is invalid HTML. This is how a MultiCheckBoxWidget is basically rendered:: label

Re[2]: [Zope3-dev] Opaque error, help

2006-11-09 Thread Adam Groszer
Hello Shane, SH For me, the value is in the comfort of a transparent database. I want SH to know exactly what Zope is storing. FileStorage makes that fairly hard. There is half-baked solution at z3c.zodbbrowser. Without knowing your exact requirements, I suggest you take a look. -- Best