Proposal: Use of dotmap or equivalent to simplify usage of the deserialized object
See original GitHub issueBecause Marshmallow provides a nice abstraction over the datamodel, it might be nice to go even further and use something like DotMap (https://github.com/drgrib/dotmap) to simplify using the objects.
E.g. instead of
user['created_at']
you could type:
user.created_at
This also provides the benefit of giving you a layer to prevent messing with the object (instead of with a visible dict data structure, where it feels like it’s more open to interference).
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
https://techdocs.broadcom.com/content/dam/broadcom...
Other entities like the creator of the item may * be added in the corresponding field. Notes on usage rights should be *...
Read more >2021年01月_weixin_39765100的博客_CSDN博客
2021-01-12. Visual indication of modal status. 2021-01-12. Proposal: Use of dotmap or equivalent to simplify usage of the deserialized object. 2021-01-12 ...
Read more >openthings的个人空间- OSCHINA - 中文开源技术交流社区
This is basically a POST that attaches an object which describes the target node. 为了调度Pod在随机的节点上,我们创建一个Binding 对象。将POST 关联到描述目标节点 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, a
post_load
method is a good place to do this. If you want to useDotMap
as the dict class for both deserialization and serialization, you can overridedict_class
, like so:Check out
__getitem__
.https://docs.python.org/3/reference/datamodel.html#object.__getitem__