Giter Club home page Giter Club logo

django-rest-framework-mongoengine's Introduction

Django Rest Framework Mongoengine

Mongoengine support for Django Rest Framework.

DRF 3

Starting from version 2.0, this package will be developed using DRF 3.0 and higher.

DRF 2

If you want to use DRFME with DRF 2, you should version 1.*. Development will be continued on drf_2_support branch.

Documentation

See full documentation here

DocumentSerializer

DocumentSerializer works just like as DRF Model Serializer. Your model fields are converted to relevant serializer fields automatically. If you want custom behavior, you can use nested serializers.

from rest_framework_mongoengine.serializers import DocumentSerializer

class BlogSerializer(DocumentSerializer):
    class Meta:
        model = Blog
        fields = ('id', 'author', 'name', 'date_created')

DynamicDocumentSerializer

A DocumentSerializer for dynamic documents.

EmbeddedDocumentSerializer

EmbeddedDocumentSerializer is used to customize EmbeddedDocument behavior, and make validations accurately. It is mentioned extensively on the documentation

Generic Views

Generic Views are named exactly the same as DRF Generic Views.

Just make sure you are using DRFME Generics.

from rest_framework_mongoengine import generics

Installation

pip install django-rest-framework-mongoengine

Note: You might consider using a specific version.

For clarity:

  • DRF2 support: pip install "django-rest-framework-mongoengine<2.0"
  • DRF3 support: pip install "django-rest-framework-mongoengine>=2.0"

Don't forget to add the package to installed apps.

INSTALLED_APPS = (
    ...
    'rest_framework_mongoengine',
)

django-rest-framework-mongoengine's People

Contributors

cptlemming avatar danpoland avatar ddesign84 avatar franckol avatar git2samus avatar j1z0 avatar mishbahr avatar neodark avatar optik avatar pmdarrow avatar rkorkosz avatar romanlv avatar tweiand-10m2 avatar umutbozkurt avatar

Watchers

 avatar

Forkers

iorlas 9nix00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.