Skip to main content

Django generic many-to-many field

Project description

© 2014-2020 Thomas Khyn

Django generic many-to-many field implementation.

This django application exposes a GM2MField that combines the features of the standard Django ManyToManyField and GenericForeighKey and that can be used exactly the same way.

It has been tested with Django 2.2.* and 3.0.* and their matching Python versions (3.5 to 3.8).

If you like django-gm2m and find it useful, you may want to thank me and encourage future development by sending a few mBTC / mBCH / mBSV at this address: 1EwENyR8RV6tMc1hsLTkPURtn5wJgaBfG9.

Features

  • Works like the built-in Django related fields

  • Creates one table per relation, like ManyToManyField, and not one big table linking anything to anything (django-generic-m2m’s default approach)

  • No need to modify nor monkey-patch the existing model classes that need to be linked

  • Automatic reverse relations when an instance is added

  • Related objects prefetching

  • Through models support

  • Deletion behaviour customization using signals

  • Migrations support

Documentation

The documentation is hosted on readthedocs. You’ll find a quick start and the description of all django-gm2m’s advanced features.

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

django-gm2m-1.0.tar.gz (25.4 kB view details)

Uploaded Source

File details

Details for the file django-gm2m-1.0.tar.gz.

File metadata

  • Download URL: django-gm2m-1.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5

File hashes

Hashes for django-gm2m-1.0.tar.gz
Algorithm Hash digest
SHA256 cc1d1a88e370a001542c105dfbd81b29ea1f7e429208cf74feb1ca5e07cce469
MD5 630bfed65b3740c15346b5f308250f67
BLAKE2b-256 7e618c2190172689cd2ffb01410b37ef715d246a6302150754eedd938ebb507e

See more details on using hashes here.

Supported by

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