{ "info": { "author": "Kim-Georg Aase", "author_email": "kim.georg.aase@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "=============================\ndjango-ordered-field\n=============================\n\n.. image:: https://badge.fury.io/py/django-ordered-field.svg\n :target: https://badge.fury.io/py/django-ordered-field\n\n.. image:: https://travis-ci.org/kimgea/django-ordered-field.svg?branch=master\n :target: https://travis-ci.org/kimgea/django-ordered-field\n\n.. image:: https://codecov.io/gh/kimgea/django-ordered-field/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/kimgea/django-ordered-field\n\nA django field to make it easy to order your model instances. If you have made an ordered list and you change the position of the list item instance then all the other list iteminstances belonging to that list has their position automatically updated to keep the list ordered without holes and list items with duplicate positions.\n``OrderedField field`` is a global ordering field for the entire table.\n``OrderedCollectionField`` order instances with respect to one or more other fields on the instance.\n\n\nRequires\n--------\n* python>=3.6\n* django>=2.0\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-ordered-field.readthedocs.io.\n\nQuickstart\n----------\n\nInstall django-ordered-field::\n\n pip install git+https://github.com/kimgea/django-ordered-field.git\n\n\nIn your models.py add the field you want ``OrderedField`` or ``OrderedCollectionField``:\n\n.. code-block:: python\n\n from django_ordered_field import OrderedField\n\n class YourModel(models.Model):\n name = models.CharField(max_length=100)\n order = OrderedField()\n\nAnd your ready to go.\n\nFeatures\n--------\n\n* ``OrderedField`` will keep correct ordering between all instances in the enire table\n* ``OrderedCollectionField`` can seperate the table in different collection based on one or more columns and keep order in each collection\n* ``update_auto_now`` will update all other fields containing auto_now=True with django.utils.timezone.now if it is set to True\n* ``extra_field_updates`` can be used to update other fields when their order is changed\n* ``self_updates_on_collection_change`` can be used to update self (current instance) when it changes collection. Setting ``self_updates_on_collection_change_like_regular`` to True will make it use the values from the extra_field_updates\n\nLimitations\n--------\n\n* Must user model.save(). queryset methods does not work\n* Order field cant be unique or in an uniqu_togheter constraint\n* After a position has been updated, other members of the collection are updated using a single SQL UPDATE statement, this means the save method of the other instances won't be called. As a partial work-around use the ``update_auto_now``, ``extra_field_updates`` and the ``self_updates_on_collection_change`` functionalities.\n\n\nCredits\n-------\n\nBased on django-positions (it did not work for django 2 at the time):\n\n* django-positions_\n\n.. _django-positions: https://github.com/jpwatts/django-positions\n\nTools used in rendering this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.1.0 (2018-04-28)\n++++++++++++++++++\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kimgea/django-ordered-field", "keywords": "django-ordered-field", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-ordered-field", "package_url": "https://pypi.org/project/django-ordered-field/", "platform": "", "project_url": "https://pypi.org/project/django-ordered-field/", "project_urls": { "Homepage": "https://github.com/kimgea/django-ordered-field" }, "release_url": "https://pypi.org/project/django-ordered-field/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Django field to help arrange model instances in an ordered fashion", "version": "1.0.0" }, "last_serial": 4159112, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "793ef93829ae69630a9607bb3b2300ae", "sha256": "9170bb44327df70415f484b38cb11fd97bb2c022fe3a371e3141afeb666e11f4" }, "downloads": -1, "filename": "django_ordered_field-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "793ef93829ae69630a9607bb3b2300ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8145, "upload_time": "2018-08-11T06:05:14", "url": "https://files.pythonhosted.org/packages/62/a6/bbdc4bba974f5dffb37a1c0c53ed611f109005a5d52f521d2767a36701f7/django_ordered_field-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12ab87ed8dfe94316e0e39fd50c61d55", "sha256": "91c25fca0ad31ee678ee139708b1038e8d30b432c967f709a2d146d24484e64c" }, "downloads": -1, "filename": "django-ordered-field-1.0.0.tar.gz", "has_sig": false, "md5_digest": "12ab87ed8dfe94316e0e39fd50c61d55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9404, "upload_time": "2018-08-11T06:05:15", "url": "https://files.pythonhosted.org/packages/0e/17/0c82444e9995a85b94082d096d700025c18c670bc882e1250bc4197d8abd/django-ordered-field-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "793ef93829ae69630a9607bb3b2300ae", "sha256": "9170bb44327df70415f484b38cb11fd97bb2c022fe3a371e3141afeb666e11f4" }, "downloads": -1, "filename": "django_ordered_field-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "793ef93829ae69630a9607bb3b2300ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8145, "upload_time": "2018-08-11T06:05:14", "url": "https://files.pythonhosted.org/packages/62/a6/bbdc4bba974f5dffb37a1c0c53ed611f109005a5d52f521d2767a36701f7/django_ordered_field-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12ab87ed8dfe94316e0e39fd50c61d55", "sha256": "91c25fca0ad31ee678ee139708b1038e8d30b432c967f709a2d146d24484e64c" }, "downloads": -1, "filename": "django-ordered-field-1.0.0.tar.gz", "has_sig": false, "md5_digest": "12ab87ed8dfe94316e0e39fd50c61d55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9404, "upload_time": "2018-08-11T06:05:15", "url": "https://files.pythonhosted.org/packages/0e/17/0c82444e9995a85b94082d096d700025c18c670bc882e1250bc4197d8abd/django-ordered-field-1.0.0.tar.gz" } ] }