mongoengine_goodjson.fields package

Submodules

mongoengine_goodjson.fields.follow_reference module

Follow Reference Field code.

class mongoengine_goodjson.fields.follow_reference.FollowReferenceField(*args, **kwargs)[source]

Bases: mongoengine.fields.ReferenceField

Follow Reference Field.

This field can be treated as a field like ReferenceField, but generates the JSON/dict of the referenced document like embedded document.

Note

This field doesn’t check recursion level. Therefore, please be careful for self-referenced document.

to_mongo(document, **kwargs)[source]

Convert to python-typed dict.

Parameters

document – The document.

to_python(value)[source]

Convert to python-based object.

Parameters

value – The python-typed document.

Module contents

Fields module.

class mongoengine_goodjson.fields.FollowReferenceField(*args, **kwargs)[source]

Bases: mongoengine.fields.ReferenceField

Follow Reference Field.

This field can be treated as a field like ReferenceField, but generates the JSON/dict of the referenced document like embedded document.

Note

This field doesn’t check recursion level. Therefore, please be careful for self-referenced document.

to_mongo(document, **kwargs)[source]

Convert to python-typed dict.

Parameters

document – The document.

to_python(value)[source]

Convert to python-based object.

Parameters

value – The python-typed document.