Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

An extension of Django ManyToMany with ordering

Project Description
django-sortedmanytomany
=======================

> 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.

Installation
------------

```sh
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 settings.py so the needed static files can be loaded:

```python
INSTALLED_APPS = (
...
'sortedmanytomany',
)
```

Using SortedManyToManyField
---------------------------

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

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

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

class Track(models.Model):
...
```

License
-------

MIT
Release History

Release History

This version
History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-sortedmanytomany-0.1.3.tar.gz (8.4 kB) Copy SHA256 Checksum SHA256 Source Oct 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting