Skip to content

lbatteau/django-rest-framework-mongoengine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mongoengine Model Serializer

Model Serializer that supports MongoEngine, for Django Rest Framework.


Usage

# model
class Blog(Document):
    owner = ReferenceField(User)
    title = StringField()
    extensions = ListField(EmbeddedDocument(BlogExtension))
    tags = ListField(StringField())
    approved = BooleanField()

# serializer
class BlogSerializer(MongoEngineModelSerializer):
    class Meta:
        model = Blog
        depth = 2
        exclude = ('approved', )

Notes:

  • MongoEngine Model Serializer also supports DynamicDocument.
  • Depth is optional and defaults to 5. It is used for ReferenceField & ListField.

Sample Output

Sample Output


Install

pip install django-rest-framework-mongoengine


Requirements


License

See LICENSE

About

MongoEngine Model Serializer for Django Rest Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%