set() and get() of IField ignored in Dexterity?

classic Classic list List threaded Threaded
9 messages Options
ajung ajung
Reply | Threaded
Open this post in threaded view
|

set() and get() of IField ignored in Dexterity?

-----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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJUe1ZGAAoJEADcfz7u4AZjct0LwJ9RpUY5WV4eTRVmqO/0hoDS
c4JIudWjsVH2KaD90J6OMGzpZmyUrNGzLEsZITRHlfRklyAokSStLsNAoBXrgfTv
S8Ky1jHJuVH5Uvwv3ntQwMTM2yaeiDm+20o7paUginX2xQ1O8dcskFw7QI22SKD9
o5EaRSXHHZnRwyucM4lAkiRce0YrldjV/3td1BzcYpkLlcEWiSQgc2+r2LXkgta9
bJz2IjLrdxSvM/qPP7Oild3XhcXuIEFE9KYDOrzP048uGrVbsSRTIPyGZRbeXatr
GcQpYS7hCZN8PCH5ij4jA3Ix9LRffz6H7fTSO/9LftgCBfo9QXUl8aPPfpaDZxws
aIfSbb42rmMmZPrnZjwjFNgJQ4UQE9vmskZy7W3YXugawpcQBXoELaKOc9eFS5zP
FN6tXlf0Rmsso8Hc437fUDAGu37LG/lhS21iJ174ReANlIujz7zY1rcWbpkgqF6i
tKJteCLQR4rrfQDc2nzSU77xFlc2T8o=
=1XDs
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
David Glick (Plone) David Glick (Plone)
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

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.

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
ajung ajung
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?



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.

Sigh...what a major fail. I wonder who wrote and designed this z3c.form
garbage.

-aj


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
ajung ajung
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

In reply to this post by David Glick (Plone)


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.

-aj


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
ajung ajung
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

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.

Now with a custom data manager it seems to be possible to solve my pain
in a working (but not necessarily consistent and nice) way.

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
johannes raggam johannes raggam
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

In reply to this post by ajung
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.


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


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers

signature.asc (188 bytes) Download Attachment
ajung ajung
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

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

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Gil Forcada Codinachs Gil Forcada Codinachs
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers

signature.asc (836 bytes) Download Attachment
ajung ajung
Reply | Threaded
Open this post in threaded view
|

Re: set() and get() of IField ignored in Dexterity?

Gil Forcada wrote:

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

In addition: this issue is a question and a discussion that does not
belong on Github for now. A bug tracker is not a place for discussions
in the first place.

Bouncing-the-ball-back
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=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers