{"categories":[{"label":"Dynamic Content","url":"https://skillfed.io/packages/category/internet-www-http-dynamic-content/2"}],"enrichment":{"capability":"Provides a drop-in replacement for Django's ManyToManyField that preserves the order of related objects, storing sort order in the database and exposing it through a custom admin widget.","skillfed_tags":["django-orm","model-fields"],"use_cases":["Gallery or portfolio models where photos must appear in a specific sequence chosen by the user.","Playlist or media collection models where track or item order is part of the data model.","Admin interfaces where users need to reorder many-to-many relationships via drag-and-drop.","Legacy database integration where you need to rename the sort field to match existing schema.","Custom through models where you want to add a __str__ method to improve admin display of relationships."],"what_it_does":"django-sortedm2m is a Django field that works exactly like the built-in ManyToManyField but remembers the order in which you add related objects. Instead of getting relations back in an arbitrary order, you get them in the order you added them, with the sort position stored in the database. This is useful for galleries, playlists, or any scenario where the sequence of related items matters.\n\nThe package provides a SortedManyToManyField class you drop into your models in place of ManyToManyField, and an optional admin widget that lets you reorder relations by dragging and dropping. It handles database migrations automatically and supports Django 4.2 through 5.1 on Python 3.7\u20133.12. There are no runtime dependencies beyond Django itself.","worth_installing":"Yes. This is a well-maintained, production-stable package with no known vulnerabilities, low install friction, and a permissive license. It solves a real Django limitation (unordered many-to-many relations) with a straightforward drop-in replacement. Use it whenever you need to preserve relation order in a Django model."},"id":"django-sortedm2m","links":{"html":"https://skillfed.io/packages/django-sortedm2m","md":"https://skillfed.io/packages/django-sortedm2m.md","pypi":"https://pypi.org/project/django-sortedm2m/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-08-11","license_spdx":null,"license_treatment":"permissive","name":"django-sortedm2m","python_support":"unspecified","summary":"Drop-in replacement for Django's many to many field with sorted relations."},"popularity":{"monthly_downloads":389270,"position":7032,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"4.0.0"}
