{ "info": { "author": "Robert Moggach", "author_email": "rob@moggach.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "=================\nDjango Principals\n=================\n\nThis module provides ``PrincipalField``, a model field for Django_ that allows\ninstances of a model to be defined as the principal instance for an entire model or\na collection of instances. When the status of one instance is changed, the status\nof other items in the collection are updated in response as necessary.\n\n\nUsage\n-----\n\nAdd a ``PrincipalField`` to your model; that's it.\n\nIf you want to work with all instances of the model as a single collection,\nthere's nothing else required. To create collections based on one or more\nfields on the model, specify the field names using the ``collection`` argument.\n\nIn general, the value assigned to a ``PrincipalField`` will be handled like a\nunique Boolean value. Setting the principal to ``True`` will\ncause all other items to become ``False``within the same collection --\nunless, of course, the collection has fewer than two elements.\n\nMulti-table model inheritance\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nBy default, if a parent model has a principal field that declares a collection,\nchild model instances are filtered independently. This behavior can be changed\nby specifying a `parent_link` argument identifying the name of the one-to-one\nfield linking the child model to the parent. If `parent_link` is set, all subclass\ninstances will be part of a single sequence in each collection.\n\n\nLimitations\n-----------\n\n* Unique constraints can't be applied to ``PrincipalField`` because they break\n the ability to update other items in a collection all at once. This one was\n a bit painful, because setting the constraint is probably the right thing to\n do from a database consistency perspective, but the overhead in additional\n queries was too much to bear.\n\nCredits\n-------\n\nThis code loosely draws on concepts inspired by django-positions_ and django-featured-item_,\ntwo projects which provide custom model fields with different functionality.\n\n\n.. _`Django`: http://www.djangoproject.com/\n\n.. _`django-positions`: https://github.com/jpwatts/django-positions\n\n.. _`django-featured-item`: https://bitbucket.org/tim_heap/django-featured-item\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/mogga/django-principals", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-principals", "package_url": "https://pypi.org/project/django-principals/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-principals/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mogga/django-principals" }, "release_url": "https://pypi.org/project/django-principals/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "A Django model field for defining a principal instance.", "version": "0.1.5" }, "last_serial": 906015, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "71a18876525e70558d641f67488f5999", "sha256": "cb02017d426f55a4edaf8935d93669cadea77fd3c99ccf0265f9c02585a37798" }, "downloads": -1, "filename": "django-principals-0.1.4.tar.gz", "has_sig": false, "md5_digest": "71a18876525e70558d641f67488f5999", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5402, "upload_time": "2013-10-26T15:29:50", "url": "https://files.pythonhosted.org/packages/d6/ce/9f61ec65de9f793cd4a35a3e6f27d6b98d5192bb837147b2e68edea39b0d/django-principals-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "fad498c218d068e1a515128966ae5c8a", "sha256": "dd491c80a17adff6f3df18da8a2601d64d4d783f91c247050dd9b3dce00c29ad" }, "downloads": -1, "filename": "django-principals-0.1.5.tar.gz", "has_sig": false, "md5_digest": "fad498c218d068e1a515128966ae5c8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5412, "upload_time": "2013-10-29T04:41:42", "url": "https://files.pythonhosted.org/packages/a6/2d/cddde6c6393b2aca258df45ab489acb7630971914fae800965fccc324878/django-principals-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fad498c218d068e1a515128966ae5c8a", "sha256": "dd491c80a17adff6f3df18da8a2601d64d4d783f91c247050dd9b3dce00c29ad" }, "downloads": -1, "filename": "django-principals-0.1.5.tar.gz", "has_sig": false, "md5_digest": "fad498c218d068e1a515128966ae5c8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5412, "upload_time": "2013-10-29T04:41:42", "url": "https://files.pythonhosted.org/packages/a6/2d/cddde6c6393b2aca258df45ab489acb7630971914fae800965fccc324878/django-principals-0.1.5.tar.gz" } ] }