Martijn Faassen wrote:
[snip Jim helping me]
Okay, that's one step closer to support for this in the annotation
package, thanks!
I've checked this in last night. There's a README.txt in
zope.app.annotation now too that explains its usage.
Regards,
Martijn
___
Martijn Faassen wrote:
Jean-Marc Orliaguet wrote:
[snip]
OK, basically you mean that the 'annotations' given in your original
post should implement a 'setdefault' method?
I don't see how that would help - you'd still end up writing a factory
that uses the setdefault, right?
I don't want
Jean-Marc Orliaguet wrote:
[snip]
OK, basically you mean that the 'annotations' given in your original
post should implement a 'setdefault' method?
I don't see how that would help - you'd still end up writing a factory
that uses the setdefault, right?
I don't want to keep repeating factory c
Martijn Faassen wrote:
Jean-Marc Orliaguet wrote:
[snip]
excuse me, but can someone explain what problem the pattern /
workaround is supposed to fix, does it create and return a default
annotation value in case an annotation key does not exist? shouldn't
the annotation machinery be "fixed"
Jean-Marc Orliaguet wrote:
[snip]
excuse me, but can someone explain what problem the pattern / workaround
is supposed to fix, does it create and return a default annotation value
in case an annotation key does not exist? shouldn't the annotation
machinery be "fixed" instead to provide getAnn
Martijn Faassen wrote:
Philipp von Weitershausen wrote:
Martijn Faassen wrote:
I stand by my conclusions on this approach sounding simple in theory,
but still being a bit harder than it should be in practice. :)
I think this is pretty simple:
def makeAnnotationAdapter(for_, factory, key)
Philipp von Weitershausen wrote:
Martijn Faassen wrote:
I stand by my conclusions on this approach sounding simple in theory,
but still being a bit harder than it should be in practice. :)
I think this is pretty simple:
def makeAnnotationAdapter(for_, factory, key):
@zope.component.adapter
Martijn Faassen wrote:
> I stand by my conclusions on this approach sounding simple in theory,
> but still being a bit harder than it should be in practice. :)
I think this is pretty simple:
def makeAnnotationAdapter(for_, factory, key):
@zope.component.adapter(for_)
@zope.interface.implement
On 3/15/06, Martijn Faassen <[EMAIL PROTECTED]> wrote:
> In the new world for ZCML, ZCML as a language falls apart in a
> minimalistic XML language, and some support code (such as
> zope.app.annotation.AnnotationFactory) to help it do more advanced things.
That's what I'd like to see! :)
> One re
Another long post, where below I take apart
zope.formlib.namedtemplate, hoping it can be used as a source of
insight into how to provide flexible extensibility (like in this
example AnnotationsAdapter concept) without needing
yet-another-ZCML-directive.
On 3/15/06, Martijn Faassen <[EMAIL PROTECTE
Jim Fulton wrote:
Martijn Faassen wrote:
...
Then this and the __component_adapts__ hack should be enough to make
it work (still an unpleasant hack, that).
Huh? Use adapter.
class FactoryFactory:
def __init__(self):
# initialize a new factory
...
Martijn Faassen wrote:
...
Then this and the __component_adapts__ hack should be enough to make it
work (still an unpleasant hack, that).
Huh? Use adapter.
class FactoryFactory:
def __init__(self):
# initialize a new factory
...
implementer(self, s
Jim Fulton wrote:
Martijn Faassen wrote:
Jim Fulton wrote:
This is one bit I was missing, thanks.
Unfortunately I read in zope/interface/README.txt that the
'implementer' function cannot be used for classes yet, so this will
change the design somewhat (I was using __call__, looks like I'l
Martijn Faassen wrote:
Jim Fulton wrote:
...
If a factory is not a class, and if it allows attributes to be
set on it, then the interface.implementor function can be used to make
declarations for it. This is documeted in zope/interfaces/README.txt
and zope/component/README.txt.
Jim Fulton wrote:
Martijn Faassen wrote:
...
I just tried to write AnnotationAdapter. Unfortunately, I haven't
gotten very far yet, as it turns out I need to understand the
internals of the implementation of the zope:adapter ZCML statement.
No, you don't.
zope:adapter has a bunch of automat
Martijn Faassen wrote:
...
I just tried to write AnnotationAdapter. Unfortunately, I haven't gotten
very far yet, as it turns out I need to understand the internals of the
implementation of the zope:adapter ZCML statement.
No, you don't.
zope:adapter has a bunch of automation to look for the
Jim Fulton wrote:
Philipp von Weitershausen wrote:
Marius Gedminas wrote:
I'd prefer
from zope.annotation.adapter import AnnotationAdapter
getFoo = AnnotationAdapter(for_=IBar,
interface=IFoo,
factory=Foo,
Philipp von Weitershausen wrote:
Marius Gedminas wrote:
I'd prefer
from zope.annotation.adapter import AnnotationAdapter
getFoo = AnnotationAdapter(for_=IBar,
interface=IFoo,
factory=Foo,
key=FOO_K
Rocky Burt wrote:
> On Fri, 2006-10-03 at 17:17 -0700, Jeff Shell wrote:
>> But I beg you not to add to the ZCML pile because you had to copy and
>> paste 12 lines of Python code. ...
>
> I haven't personally formed an opinion on where this sort of thing
> should go, but copying and pasting 12 li
19 matches
Mail list logo