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: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 ok, if i recall all the decisions again, and IIRC, the necessity of setter/getter can maybe resolved... the widget returns a datetime object timezone-naively. the start/end setter of EventBasic applies a FakeZone, because on the context there might be already a timezone-aware start/end date (if the event is beeing edited instead of created). so, if we hadn't the FakeZone applied, in case of editing an event, some z3c.form validator or something compares the timezone-naive value from the widget to the timezone-aware value from the context and throws an error. timezone-naive dt cannot be compared to timezone-aware ones... > > W. > > > ------------------------------------------------------------------------------ > 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 -- 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) iEYEABECAAYFAlMhsS8ACgkQW4mNMQxDgAcRyACgsscpiDgJiJYPwflob2qHiLT9 MvgAoMdJl17xZeZoNqbR5j2NtWndclWp =zO8e -----END PGP SIGNATURE-----