[z3-five] can't import an interface into a page template
Tim Hicks
tim at sitefusion.co.uk
Wed Nov 17 11:55:32 MET 2004
Martijn Faassen said:
> Tim Hicks wrote:
>> I'm trying to get hold of an interface (of the zope3 variety) from a zpt
>> so that I can adapt to it. So, my zpt has::
>>
>> <tal:dummy define="IMessageFlags
>> modules/Products.atemail.interfaces.IMessageFlags">
>>
>
> Typically I'd say that isn't the business of a page template at all and
> that such adaptation should take place in Python code. Add a class to
> your template and create a method that can do the adaptation for you.
Yes, I understand that what I'm doing is rather a nasty mixing of
presentation and logic. But, what I'm trying to do is gently ease some
zope3/five patterns into a plone/archetypes setting. The zpt in question
is actually providing a custom 'view' for an archetypes object. Thus, I'm
not sure how I could 'add a class to [my] template'.
> As to importing stuff into Five zpts; security is turned off so this
> should Just Work without any Zope 2 security magic. However, I've never
> tried, so I don't even know what the syntax should be. :)
It's just a standard zpt operating through a cmf/plone skin - so I guess
security is turned on ;-).
I wonder if I'm going about this the write way? Essentially I'm trying to
get my standard zope2 zpt to behave like a 'view' I think - i.e. calling
logic code. This has hack written all over it, but I don't know how else
to ease interfaces/adapters into an archetypes environment.
Any pointers much appreciated.
tim
More information about the z3-five
mailing list