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.*, 3.0.*, 3.1.*, 3.2.*, 4.0.*, 4.1.*, 4.2.*, 5.0.*, 5.1.*, 5.2.* and their compatible Python versions (3.8 to 3.13).

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_gm2m-1.3-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file django_gm2m-1.3-py3-none-any.whl.

File metadata

  • Download URL: django_gm2m-1.3-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for django_gm2m-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b68c1b1c0bd5152b05b70ec088dece1f301a738f002ad05fe8ba09df0d19432d
MD5 b3bef6a9fa9880be6bd74a105004e87a
BLAKE2b-256 f13cc61e9a1fa512f8fc86843c5bd4830cb64d43e44b464c23e7642f4d6d2221

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