Skip to main content

Allows for automatic serialization of Djongo fields w/ Django REST

Project description

rest-meets-djongo

A package which enables serialization of Djongo fields with django-rest-framework's (DRF) serializers and viewsets

Features

NOTE: This repo is currently under development, and most (if not all) of its features are likely to throw errors or behave in unexpected ways; use at your own risk

Similiar to DRF ModelSerializers, creating serializers using DjongoModelSerializer allows for the following fields to be detected and managed through DRF's serializer setup. These fields include Djongo's:

  • ObjectIDField
  • EmbeddedModelField (both as a standalone field and as a custom built serializer)
  • ArrayModelField
  • ArrayReferenceField

Usage

  1. Install rest-meets-djongo:
    pip install rest_meets_djongo
    
  2. Into settings.py file of your project, add:
    INSTALLED_APPS = [
        ...
        'rest_meets_djongo',
    ]
    
  3. Replace REST's 'ModelSerializer' with 'DjongoModelSerializer' and enjoy the automation of EmbeddedModels and ObjectID fields!

Requirements:

(Earlier version testing is currently being testing; these are just the confirmed functional versions)

  1. Python 3.6 or higher
  2. MongoDB 4.0 or higher
  3. djangorestframework 3.9 or higher
  4. djongo 1.2 or higher

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rest-meets-djongo, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size rest_meets_djongo-0.0.1.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page