Skip to main content

django-toggle-m2m

Installation

pip install django_toggle_m2m

Usage in models

from django.db import models

from django_toggle_m2m.toggle import ToggleManyToMany


class Publication(models.Model):
    title = models.CharField(max_length=32)


class Article(models.Model, ToggleManyToMany):
    # ______________________^
    # Extend ToggleManyToMany class
    headline = models.CharField(max_length=256)
    publications = models.ManyToManyField(Publication)

    # Define M2M fields that are toggleable
    TOGGLEABLE_FIELDS = ('publications',)

Relation toggling

article = Article.objects.create(...)
publication = Publication.objects.create(...)

article.toggle_publications(instance=publication) # Will be added
article.toggle_publications(instance=publication) # Will be removed

Development

git clone https://github.com/wencakisa/django-toggle-m2m.git
pip install django_toggle_m2m

Interesting fact - https://code.djangoproject.com/ticket/20686

Metadata

Release files for django-toggle-m2m 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-toggle-m2m 0.0.6
File Size Uploaded Provenance Actions
django_toggle_m2m-0.0.6.tar.gz 3.2 kB Without provenance Details for django_toggle_m2m-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-toggle-m2m 0.0.6
File Interpreter ABI Platform Actions
django_toggle_m2m-0.0.6-py2.py3-none-any.whl Python 3, Python 2 none any Details for django_toggle_m2m-0.0.6-py2.py3-none-any.whl

Total release size: 6.7 kB

Release files / django_toggle_m2m-0.0.6.tar.gz

Download URL django_toggle_m2m-0.0.6.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b4b95d355d24e9838c6212acc641cd1817c0a7aad1d1f28c013e16947bc3ff0d
BLAKE2b-256 checksum
How to use checksums
38dfc33da1ef15c5c801912928c3ea26b288019203c1fef2005f566a7bb02daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / django_toggle_m2m-0.0.6-py2.py3-none-any.whl

Download URL django_toggle_m2m-0.0.6-py2.py3-none-any.whl
Size 3.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
42f65bc9d437d19f3bd7e99daf1a35c29dea3914b49522f022ca0bafb6da4e72
BLAKE2b-256 checksum
How to use checksums
455fc0df8b7821fc8d8dde4663836fc7137d984160a5f5a8b7478ed16c5a6a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Security for django-toggle-m2m 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page