{ "info": { "author": "Mishbah Razzaque", "author_email": "mishbah@jp74.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "django-suit-sortable\n====================\n\nDrag-and-drop ordering for objects and inlines in Django admin using [django-suit](https://github.com/darklow/django-suit).\n\n## Installation\n\tpip install -e git://github.com/JP74/django-suit-sortable.git#egg=suit_sortable\n\n## Configuration\n\n1. Add `suit_sortable` to your `INSTALLED_APPS`.\n2. Ensure `django.core.context_processors.static` is in your `TEMPLATE_CONTEXT_PROCESSORS`.\n\n\nTo use suit_sortable you must do following:\n\nIn your ``models.py`` file add integer property for sortable to you model:\n\n from django.db import models\n\n class Category(models.Model):\n ...\n position = models.PositiveIntegerField()\n\n\n### Adding Sortable to an existing model\n\nIf you're adding Sorting to an existing model, it is recommended that you use [django-south](http://south.areacode.com/) to create a schema migration to add the \"position\" field to your model. You will also need to create a data migration in order to add the appropriate values for the `position` column.\n\nExample assuming a model named \"Category\":\n\n def forwards(self, orm):\n for index, category in enumerate(orm.Category.objects.all()):\n category.position = index + 1\n category.save()\n\n\n\n### Django Admin Integration\nTo enable sorting in the admin, you need to inherit from `SortableAdmin` \nand add a `list_editable` column for the `position` field:\n\n from django.contrib import admin\n from myapp.models import MySortableClass\n from suit_sortable.admin import SortableAdmin\n\n class MySortableAdminClass(SortableAdmin):\n list_display = (..., 'position',)\n list_editable = ('position',)\n \"\"\"Any other admin options you need go here\"\"\"\n\n admin.site.register(MySortableClass, MySortableAdminClass)\n\n\nTo enable sorting on TabularInline models, you need to inherit from\nSortableTabularInline:\n\n from suit_sortable.admin import SortableTabularInline\n\n class MySortableTabularInline(SortableTabularInline):\n \"\"\"Your inline options go here\"\"\"\n\n\nTo enable sorting on StackedInline models, you need to inherit from\nSortableStackedInline:\n\n from suit_sortable.admin import SortableStackedInline\n\n class MySortableStackedInline(SortableStackedInline):\n \"\"\"Your inline options go here\"\"\"\n\n\n### Limitations\n\nSince sortables are based on JavaScript solution, there are known limitations:\n\n1. It doesn't work with pagination.\n\n\n\n\nHistory\n-------\n\n0.1.0 (2013-08-15)\n++++++++++++++++++\n\n* First release on Github.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JP74/django-suit-sortable", "keywords": "suit_sortable", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-suit-sortable", "package_url": "https://pypi.org/project/django-suit-sortable/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-suit-sortable/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/JP74/django-suit-sortable" }, "release_url": "https://pypi.org/project/django-suit-sortable/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Drag-and-drop ordering for objects and inlines in Django admin using django-suit.", "version": "0.1.0" }, "last_serial": 1314599, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b37d00ac6bdab4405ff7051a9a207cf1", "sha256": "45b17bce6ffc0351d70df463d0af202f33579ba2f98aef7aeac40dc08d4e28ca" }, "downloads": -1, "filename": "django-suit-sortable-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b37d00ac6bdab4405ff7051a9a207cf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16509, "upload_time": "2014-11-20T16:18:53", "url": "https://files.pythonhosted.org/packages/fa/68/e3413f45b07eac3885358ba5cd4f7f48800278f9ed608a1eb301e286396f/django-suit-sortable-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b37d00ac6bdab4405ff7051a9a207cf1", "sha256": "45b17bce6ffc0351d70df463d0af202f33579ba2f98aef7aeac40dc08d4e28ca" }, "downloads": -1, "filename": "django-suit-sortable-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b37d00ac6bdab4405ff7051a9a207cf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16509, "upload_time": "2014-11-20T16:18:53", "url": "https://files.pythonhosted.org/packages/fa/68/e3413f45b07eac3885358ba5cd4f7f48800278f9ed608a1eb301e286396f/django-suit-sortable-0.1.0.tar.gz" } ] }