Skip to main content

Allows for automatic serialization of Djongo fields w/ Django REST

Project description

rest-meets-djongo

This package enables default model serializers for models with Djongo fields to be generated, for use in Django-Rest-Framework apps

Features

NOTE: This repo is currently under active development, and many of the features of the package may act in strange ways. Please report any issues to GitLab or GitHub as you find them

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

  • ObjectIDField
  • EmbeddedModelField
  • ArrayModelField

The following are currently not fully functional, and as a result are not explicitly supported (yet):

  • ForeignKeyField (Reverse relations are not generated, even if specified, by Djongo)
  • ManyToManyField (Reverse relations are not generated, even if specified, by Djongo)
  • ArrayReferenceField (WIP)

Installation

  1. Install rest-meets-djongo:
    pip install rest-meets-djongo
    
  2. Replace REST's 'ModelSerializer' with 'DjongoModelSerializer' and enjoy!

Requirements

(Alternate version testing is currently underway; 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.11
Filename, size File type Python version Upload date Hashes
Filename, size rest_meets_djongo-0.0.11.tar.gz (12.1 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