Re: How to edit dexterity types without needing to know about their behaviors

"David Glick (Plone)" <david.glick-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
On 3/13/14, 8:16 AM, Johannes Raggam wrote:
>
> Why not just use an event base class or mixin instead of a behaviour? That way you get the property normally and don’t force people to play adapter-games.
> i want to avoid that using a base class, because i want to be able to
> just add the IEventBasic behavior to a content object and get full
> eventish behavior then. i love the concept of behaviors for that.
>
> i'm thinking of doing it differently - maybe there is some hook in
> z3c.form for which i can register an adapter and apply a fake zone
> before it comes to the comparison? can someone point me to right corner
> in the viscus of z3c.form?
> or i let the widget apply some fakezone to the datetime value.

It may make sense to do this in the data converter, which is an adapter 
of (field, widget).

> then, in the data_postprocessing event listener, i'd apply the real
> timezone to the value given by the widget, store that on start/end
> attributes, then convert it to utc and store the utc value to _start or
> _end. the start indexer returns then the _start resp. _end attributes
> instead.
>
> which leaves the question if we'd need _start and _end attributes at
> all... if the datetime widgets would provide a timezone field, and
> return localized datetime values... then we could also drop the timezone
> attribute, we'd support events starting in one zone and ending in
> another and all these issues would have been gone.
>
> if we'd finally eliminate the timezone concept globally on earth,
> humankind would live in peace and happiness.
>
Amen.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.