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

Johannes Raggam <[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
On Thu, 2014-03-13 at 14:36 +0100, Wichert Akkerman wrote:
> On 13 Mar 2014, at 14:22, Johannes Raggam <[email protected]> wrote:
> 
> > On Thu, 2014-03-13 at 14:13 +0100, Wichert Akkerman wrote:
> >> On 13 Mar 2014, at 14:08, Martin Aspeli <[email protected]> wrote:
> >> 
> >>> I don't understand the problem. How would magic attribute resolution be better than something described in an interface using the adapter patten?
> >> 
> >> Why is an adapter necessary for standard attributes like the start time for an event? I don’t understand that part.
> > 
> > look here:
> > https://github.com/plone/plone.app.event/blob/master/plone/app/event/dx/behaviors.py#L341
> 
> 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.

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.


thoughts?


> 
> 

-- 
programmatic  web development
di(fh) johannes raggam / thet
python plone zope development
plone framework  team  member
mail: office-//[email protected]
web:  http://programmatic.pro
      http://bluedynamics.com

------------------------------------------------------------------------------
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

_______________________________________________
Plone-developers mailing list
Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/plone-developers
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEABECAAYFAlMhy9QACgkQW4mNMQxDgAf2ugCg0UePbe+KPEcRBwFJ1ryK3T1j
C4kAn20SzcccBMIhZdNYQ1H/lxZ23Hi6
=GLlW
-----END PGP SIGNATURE-----
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.