{ "info": { "author": "Edwin van Opstal", "author_email": "evo.se-technology.com", "bugtrack_url": null, "classifiers": [], "description": "==============================================================\ndjangoutillib - collection of generic django utility functions\n==============================================================\n\nDjango Utility Library is a small collection of generic functions and classes\nfor use with Django. Other than django there are no external dependencies.\n\nWorking with CHOICES tuples\n===========================\n\nDjango provides no easy way for doing lookup in CHOICES tuples other than\n``get_FIELD_display()`` in a database context. For using CHOICES tuples without\na database and for doing reverse lookup this library has two functions:\n``get_choice_name`` and ``get_choice_value``. Furthermore there is a function\nto 'translate' a CHOICES tuple with groups to a 'flat' tuple.\nFor the following examples, these CHOICES tuples are used::\n\n SIMPLE_CHOICES = (\n (0, 'zero'),\n (1, 'one'),\n (2, 'two'),\n (3, 'three'),\n )\n GROUPED_CHOICES = (\n ('group1', (\n (0, 'zero'),\n (1, 'one'),\n )),\n ('group2', (\n (2, 'two'),\n (3, 'three'),\n )),\n ('nogroup', 'four'),\n )\n\nget_choice_name()\n-----------------\n\nReturns the human readable name of the specified (database) value, which works\non a flat CHOICES tuple as well as one with groups::\n\n >>> import djangoutillib.utils as du\n >>> du.get_choice_name(SIMPLE_CHOICES, 2)\n two\n >>> du.get_choice_name(SIMPLE_CHOICES, 5)\n KeyError: 5\n >>> du.get_choice_name(GROUPED_CHOICES, 3)\n three\n >>> du.get_choice_name(GROUPED_CHOICES, 'nogroup')\n four\n\nget_choice_value()\n------------------\n\nReturns the (database) value of the specified human readable name, which works\non a flat CHOICES tuple as well as one with groups::\n\n >>> import djangoutillib.utils as du\n >>> du.get_choice_value(SIMPLE_CHOICES, 'two')\n 2\n >>> du.get_choice_value(GROUPED_CHOICES, 'three')\n 3\n >>> du.get_choice_value(GROUPED_CHOICES, 'four')\n nogroup\n >>> du.get_choice_value(GROUPED_CHOICES, 'five')\n KeyError: 'five'\n\ndegroup_choices()\n-----------------\n\nReturns a version of grouped_choices with its groups removed::\n\n >>> import djangoutillib.utils as du\n >>> du.degroup_choices(GROUPED_CHOICES)\n [(0, 'zero'), (1, 'one'), (2, 'two'), (3, 'three'), ('nogroup', 'four')]", "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/EdwinvO/djangoutillib", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "djangoutillib", "package_url": "https://pypi.org/project/djangoutillib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djangoutillib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/EdwinvO/djangoutillib" }, "release_url": "https://pypi.org/project/djangoutillib/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Collection of generic django utilities", "version": "0.1.0" }, "last_serial": 791180, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7628450a9a517c71e5f7bdcf481d2f65", "sha256": "caeecba25d3c5da7d078ef2e4a3a7f42c450f17f5896cc0f5da080326daadf83" }, "downloads": -1, "filename": "djangoutillib-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7628450a9a517c71e5f7bdcf481d2f65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18854, "upload_time": "2013-05-07T05:13:07", "url": "https://files.pythonhosted.org/packages/60/19/d7aa2c2336145f9b17aa6697971c55171e237b8a875fb6e28c45774ba040/djangoutillib-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7628450a9a517c71e5f7bdcf481d2f65", "sha256": "caeecba25d3c5da7d078ef2e4a3a7f42c450f17f5896cc0f5da080326daadf83" }, "downloads": -1, "filename": "djangoutillib-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7628450a9a517c71e5f7bdcf481d2f65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18854, "upload_time": "2013-05-07T05:13:07", "url": "https://files.pythonhosted.org/packages/60/19/d7aa2c2336145f9b17aa6697971c55171e237b8a875fb6e28c45774ba040/djangoutillib-0.1.0.tar.gz" } ] }