{ "info": { "author": "Serkan Hosca", "author_email": "serkan@hosca.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: WWW/HTTP" ], "description": "Django REST EnumField\n=====================\n\n|Build Status| |PyPI version| |Coveralls Status| |Black|\n\n**EnumField that uses python enums for Django REST Framework**\n\nInstallation\n============\n\n::\n\n pip install django-rest-enumfield\n\n\nUsage\n=====\n\nUse it as if its a ``ChoiceField``:\n\n.. code:: python\n\n import enum\n from rest_enumfield import EnumField\n\n class Color(enum.Enum):\n RED = \"red\"\n GREEN = \"green\"\n BLUE = \"blue\"\n\n class SomeSerializer(Serializer):\n\n color = EnumField(choices=Color)\n\n\nAdditionally you can override choice name and value generation by providing ``to_choice`` or ``to_repr`` arguments:\n\n.. code:: python\n\n class SomeSerializer(Serializer):\n\n color = EnumField(choices=Color, to_choice=lambda x: (x.value, x.name), to_repr=lambda x: x.value)\n\nThis will cause the enum's value instead of the name to be represented.\n\nThats it.\n\n.. |Build Status| image:: https://travis-ci.com/shosca/django-rest-enumfield.svg?branch=master\n :target: https://travis-ci.com/shosca/django-rest-enumfield\n.. |PyPI version| image:: https://badge.fury.io/py/django-rest-enumfield.svg\n :target: https://badge.fury.io/py/django-rest-enumfield\n.. |Coveralls Status| image:: https://coveralls.io/repos/github/shosca/django-rest-enumfield/badge.svg?branch=master\n :target: https://coveralls.io/github/shosca/django-rest-enumfield?branch=master\n.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/ambv/black\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/shosca/django-rest-enumfield", "keywords": "enum django rest framework drf rest_framework", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-rest-enumfield", "package_url": "https://pypi.org/project/django-rest-enumfield/", "platform": "", "project_url": "https://pypi.org/project/django-rest-enumfield/", "project_urls": { "Homepage": "https://github.com/shosca/django-rest-enumfield" }, "release_url": "https://pypi.org/project/django-rest-enumfield/0.2.0/", "requires_dist": [ "django", "djangorestframework" ], "requires_python": "", "summary": "EnumField for Django REST Framework", "version": "0.2.0" }, "last_serial": 5762678, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "9476d87525119a790a815ee037213949", "sha256": "fff37d35fb9d5e9a001fab2bfa7dc34eb92339bbb4aa2be359846cb0afb91d64" }, "downloads": -1, "filename": "django_rest_enumfield-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9476d87525119a790a815ee037213949", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3221, "upload_time": "2019-06-28T12:12:47", "url": "https://files.pythonhosted.org/packages/42/33/861e5c776addcd40a831297ab0b1f08fab41b4f7d057c5c27dd25892b951/django_rest_enumfield-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14e261a3fbdad64a09f570c0fedfb531", "sha256": "a085fe68f220cad900d2f99613530c9283b8cfe02229c8a2722aa73e539b9315" }, "downloads": -1, "filename": "django-rest-enumfield-0.1.1.tar.gz", "has_sig": false, "md5_digest": "14e261a3fbdad64a09f570c0fedfb531", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3030, "upload_time": "2019-06-28T12:12:49", "url": "https://files.pythonhosted.org/packages/80/b9/f3921ea5ca909eecd2806b3814e756a2663bac828ca901624096a08b41d1/django-rest-enumfield-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "849d05d906ad8aaaf6ad0179dcdff848", "sha256": "30965e5269dc1b0de33354ebb85cb1363339394f749b4752e4fb08741fb59b6e" }, "downloads": -1, "filename": "django_rest_enumfield-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "849d05d906ad8aaaf6ad0179dcdff848", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4060, "upload_time": "2019-06-28T13:25:12", "url": "https://files.pythonhosted.org/packages/d5/05/c1ccc8bfe05c7d646d2385d928afc04c534148c6e055514c7ab954116c46/django_rest_enumfield-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81302efad831d1407841b20a37c3c187", "sha256": "f0f7866e5bfdd665447a577dbc49a4a6ea83a2942312b2c5c64d35edd214805f" }, "downloads": -1, "filename": "django-rest-enumfield-0.1.2.tar.gz", "has_sig": false, "md5_digest": "81302efad831d1407841b20a37c3c187", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3032, "upload_time": "2019-06-28T13:25:13", "url": "https://files.pythonhosted.org/packages/2a/10/51b274119294189b6ff76157953643545dc1129e43562b910695d92f13eb/django-rest-enumfield-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b3f55c6ea66fd41371570dfdc8154257", "sha256": "80792326d5d8fad8a66729e9404a4078fe16f7eb8b2a910b37157d96df415611" }, "downloads": -1, "filename": "django_rest_enumfield-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b3f55c6ea66fd41371570dfdc8154257", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3979, "upload_time": "2019-08-30T23:54:08", "url": "https://files.pythonhosted.org/packages/9c/27/e7b1b166a3e36983f73b49bfcb974e29f46807c3ebc1a2c5fc0ec0e8a8d9/django_rest_enumfield-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c06eb094fbbcf55d3c1621ba459edec4", "sha256": "0e3c1121e136dd7163c92737dcd67e0c6b78e78793b740b0811753343c7da8fe" }, "downloads": -1, "filename": "django-rest-enumfield-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c06eb094fbbcf55d3c1621ba459edec4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3041, "upload_time": "2019-08-30T23:54:10", "url": "https://files.pythonhosted.org/packages/7d/ff/ab47c411c40253fd3fd66ebc04f2bd4e9034559f19d28aabef49f0f00689/django-rest-enumfield-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b3f55c6ea66fd41371570dfdc8154257", "sha256": "80792326d5d8fad8a66729e9404a4078fe16f7eb8b2a910b37157d96df415611" }, "downloads": -1, "filename": "django_rest_enumfield-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b3f55c6ea66fd41371570dfdc8154257", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3979, "upload_time": "2019-08-30T23:54:08", "url": "https://files.pythonhosted.org/packages/9c/27/e7b1b166a3e36983f73b49bfcb974e29f46807c3ebc1a2c5fc0ec0e8a8d9/django_rest_enumfield-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c06eb094fbbcf55d3c1621ba459edec4", "sha256": "0e3c1121e136dd7163c92737dcd67e0c6b78e78793b740b0811753343c7da8fe" }, "downloads": -1, "filename": "django-rest-enumfield-0.2.0.tar.gz", "has_sig": false, "md5_digest": "c06eb094fbbcf55d3c1621ba459edec4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3041, "upload_time": "2019-08-30T23:54:10", "url": "https://files.pythonhosted.org/packages/7d/ff/ab47c411c40253fd3fd66ebc04f2bd4e9034559f19d28aabef49f0f00689/django-rest-enumfield-0.2.0.tar.gz" } ] }