[Pulp-dev] JSON Field Implementation

Jeff Ortel jortel at redhat.com
Tue Aug 23 20:08:52 UTC 2016



On 08/23/2016 02:53 PM, Brian Bouterse wrote:
> One related comment on this is my desire to avoid getters and setters.
> 
> For example let's say my_field is the JSON field. I hope we can do this:
> 
> my_model = TheModelClass()
> my_model.my_field = {'a': 1, 'b': 2}  # this is setting with a dict
> my_mode.save()  # the field contents are now JSON serialized in the DB
> 
> Also this:
> 
> my_model = TheModelClass.get(pk='12345')
> type(my_model.my_field)  # This would show dictionary not string
> 
> Is that possible with this implementation idea? What do others think about this?

Agreed, this behavior is important.

> 
> Thanks for doing this @pcreech!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 847 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20160823/7bf2c490/attachment.sig>


More information about the Pulp-dev mailing list