On Tue, 2016-08-23 at 15:53 -0400, 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

This will be abstracted, as it is on all other models to work like this.

> Also this:
> 
> my_model = TheModelClass.get(pk='12345')
> type(my_model.my_field)  # This would show dictionary not string

I'm not sure of what the resulting type it will definitely show is, but I am 
fairly confident it
will not be a string, as the whole point of implementing the custom field is to 
abstract away the
underlying storage mechanism's data format with the data format the code is 
excpecting to work with.


> Is that possible with this implementation idea? What do others think 
> about this?
> 
> Thanks for doing this @pcreech!

No problemo!

> -Brian
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Pulp-dev mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/pulp-dev

Reply via email to