Re: set() and get() of IField ignored in Dexterity?
Gil Forcada <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <1417562416.25810.2.camel@patam> |
Hi, El dt 02 de 12 de 2014 a les 11:33 +0100, en/na Andreas Jung va escriure: > Johannes Raggam wrote: > > On Mon, 2014-12-01 at 13:42 +0100, Andreas Jung wrote: > >> David Glick (Plone) wrote: > >>> On 11/30/14, 9:39 AM, Andreas Jung wrote: > >>>> -----BEGIN PGP SIGNED MESSAGE----- > >>>> Hash: SHA1 > >>>> > >>>> I implemented an XML field for Dexterity > >>>> > >>>> https://bitbucket.org/onkopedia/zopyx.existdb/src/438c6daa6bf3f5ac0c0a08b602e1f9927ead058a/zopyx/existdb/dx/fields.py?at=dexterity > >>>> > >>>> which is working nicely with plone.schemaeditor. > >>>> > >>>> However: the set() and get() methods are completely > >>>> ignored. Is there something in Dexterity by-passing > >>>> these methods? > >>>> > >>>> - -aj > >>>> > >>> The default z3c.form data manager is z3c.form.datamanager.AttributeField > >>> which just does setattr and getattr on the (possibly adapted) context. > >>> If you want the field's get/set to be used, you'll either have to write > >>> a custom data manager for your field, or use a custom content item class > >>> that uses property descriptors. > >> This is perhaps an option when you define your content-types in Python > >> code but completely unusable for TTW content-types. > > > > The data manager would adapt a generic context and your specific field. > > So, if you create this data-manager and create a TTW content type using > > this field, it should use your data manager. > > I am using a custom data manager right now and this should work fine (in > fact it does work fine with my prototype) for both content-types create > TTW or programmatically. I am more concerned we now have a third > (necessary) way for dealing with get/set operations where the storage > handling can not be implemented through a behavior but instead on the > field level or in this case through the data manager (which belong > to the z3c.form widget level) on the completely improper framework > level. I am not opening a new discussion here but I just need to mention > that the set/get implementation in Dexterity is even more flawed that > I first thought. I can deal with this on the application level...so > don't fear a further shit storm from my side :-P I would actually expect issues filed on github and, if possible, some patches or at least designs on how to improve the current brokeness :) Cheers, gil > Andreas > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Plone-developers mailing list > Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/plone-developers -- Gil Forcada [ca] guifi.net - una xarxa lliure que no para de créixer [en] guifi.net - a non-stopping free network bloc: http://gil.badall.net planet: http://planet.guifi.net ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ Plone-developers mailing list Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/plone-developers
signature.asc
(application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCgAGBQJUfkkwAAoJEOkuw3EAluZadEYP/R+JouzvQNvKc2LM/El6qcVt laqaPVjEnpurkg0rOpWG79qshQ4jsNnTzuCEf7+LVAlQKFiRDU75orOrTpTM4Bu7 p4Rt/C95Z5XDJs4W5Rrn7F9X6SI4RU2Dls7gMXRBcZgdQFRU4UUz3oFZd6N5sztf 61LqBWAoyKj1hedxiZ6ILZY4zNI6sxhgTMOOXg7453hz+duTF0uCyFbDt8ZeZtQ7 v9+vwJfI2GONr8HyoKcH5ks0apw8cgSGjCsA49MXwwiHKKmZDRORug13o5C1U7xx eSeyUckUZ1hvvCE80HtvvwtmUhIWPKopeBsAAqUdudlQs+6Dto05Vw8k/Kxg22C3 EqTcqUrOqwILhQxYP7QD72jpIGmmOfI3O0kzBCKtm0eKcXI9CQKCxfRFYYxdMHDW WYcjr/uW4nWGJF23YykNDjeRPpwhNBSKedE1A7BabT12o20W3Bi75wxCxqHxf31O MQRQIv0j67unlFNAkrDrrQFiP6ZWHe1ZbeC/DuZMsWlhr1SkrBIzjxc5v8WqfIxd B4k3ENA51nMNyDEQH+W+4t1YibawsCt2eJfus/MJWsZeZNMbJSKe3EhwlnFM27Tv XkvOEEJuluU+hs5q9jTTUE3bEB2agyVZ+dKOFRnkexRbfTnK+bFV7A3zpZRMUWoC Fu+v6dqXrqCYRrBK+4ca =v4Uj -----END PGP SIGNATURE-----