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 'https://gitlab.com/SomeoneInParticular/rest_meets_djongo/issues' 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.

Source Distribution

rest_meets_djongo-0.0.7.tar.gz (11.6 kB view details)

Uploaded Source

File details

Details for the file rest_meets_djongo-0.0.7.tar.gz.

File metadata

  • Download URL: rest_meets_djongo-0.0.7.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for rest_meets_djongo-0.0.7.tar.gz
Algorithm Hash digest
SHA256 5cf9727561d234d550d0bd4c65ce98c0e2d63d8bf38fb360f95c02ff269cc0c7
MD5 d6b5905020144fb8433769e56f457f29
BLAKE2b-256 bf642f7ab3bba5925a6bbc0352ef26ab9ea0a0b5d93aedb30ee3a4035c771484

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page