Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

An extension of Django ManyToMany with ordering

Project description


> In Django, if you need to order a many to many relation you will have to do it by using inlines width a foreign key and a sorting field. If there is no need to add another field in this relation, use inlines would make the admin interface complex where a simple many to many should do the trick.


pip install django-sortedmanytomany

Adding to installed apps

- To use the many to many sorted field, you have to add it to your INSTALLED_APPS on your project's so the needed static files can be loaded:


Using SortedManyToManyField

- To use SortedManyToMany field, just create a field as if you were adding the default ManyToMany

from django.db import models
from sortedmanytomany.models import SortedManyToManyField

class Album(models.Model):
tracks = SortedManyToManyField('Track')

class Track(models.Model):



Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-sortedmanytomany, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size django-sortedmanytomany-0.1.3.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page