flexeval.classes.jsonview#
Classes
|
Descriptor that provides dict-like access to a JSON text field. |
|
Dictionary that syncs changes back to the model field. |
- class flexeval.classes.jsonview.JsonView(text_field_attr_name)[source]#
Bases:
objectDescriptor that provides dict-like access to a JSON text field.
Example: class SomeModel(pw.Model):
some_field = pw.TextField(default=”{}”) some_field_dict = JsonView(text_field_attr_name=”some_field”)
- class flexeval.classes.jsonview.JsonViewDict(model_instance, text_field_attr_name, json_dumps_fn=<function dumps>, json_loads_fn=<function loads>)[source]#
Bases:
UserDictDictionary that syncs changes back to the model field.
- pop(k[, d]) v, remove specified key and return the corresponding value.[source]#
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair[source]#
as a 2-tuple; but raise KeyError if D is empty.