jazzband / jsonmodels

jsonmodels is library to make it easier for you to deal with structures that are converted to, or read from JSON.
http://jsonmodels.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
334 stars 51 forks source link

Use descriptors in field classes #43

Closed hgenru closed 9 years ago

hgenru commented 9 years ago

prerequisites: Now the model can be put invalid data. And we find out about it only after a full validation of the model. And the model would essentially be broken.

solution: Use data descriptor and prevent placement in the model invalid data.

beregond commented 9 years ago

Yes, I know, I already planned that in #22 :) - also because some other features are unavailable without descriptors.

hgenru commented 9 years ago

Nice. Have any thoughts about this? I can implement this feature, but it would be good to first agree on.

hgenru commented 9 years ago

Can be implemented the desired behavior through us __setattr__. Maybe it will be even easier.

beregond commented 9 years ago

@hgenru - let me do it myself, there are some changes in inner API that are required for change and I have already view for that. I'll try to deliver that asap.

hgenru commented 9 years ago

Ok. I wanted to use your library in my one project. And this functionality is extremely necessary to me. While I will use what is.

If you need help - call me.

beregond commented 9 years ago

@hgenru - ok, your help is much appriciated :) please see #44