# Django IntEnumField
[![Build Status](https://api.travis-ci.org/HearthSim/django-intenumfield.svg?branch=master)](https://travis-ci.org/HearthSim/django-intenumfield)
An IntEnumField for Django.
## Features
* Store your multiple-choice options as a smallint (2 bytes) instead of varchar
* Reuse existing IntEnums as choice values
* Integrates well with Django's admin app (display and filter)
## Requirements
* Python 3.6+
* Django 2.2+
## Usage
```py
from enum import IntEnum
from django.db import models
from django_intenum import IntEnumField
class Status(IntEnum):
UNKNOWN = 0
IN_PROGRESS = 1
COMPLETED = 2
ERROR = 3
class Job(models.Model):
status = IntEnumField(enum=Status)
```
## License
This project is licensed under the MIT license. The full license text is
available in the LICENSE file.
Raw data
{
"_id": null,
"home_page": "https://github.com/HearthSim/django-intenumfield",
"name": "django-intenumfield",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6,<4.0",
"maintainer_email": "",
"keywords": "django,intenum",
"author": "Jerome Leclanche",
"author_email": "jerome@leclan.ch",
"download_url": "https://files.pythonhosted.org/packages/a8/6d/ff04c0aeae3e89c17e85fb0055db663afd0cfc8179f75b0184ba15c5b512/django_intenumfield-1.5.0.tar.gz",
"platform": null,
"description": "# Django IntEnumField\n\n[![Build Status](https://api.travis-ci.org/HearthSim/django-intenumfield.svg?branch=master)](https://travis-ci.org/HearthSim/django-intenumfield)\n\nAn IntEnumField for Django.\n\n## Features\n\n* Store your multiple-choice options as a smallint (2 bytes) instead of varchar\n* Reuse existing IntEnums as choice values\n* Integrates well with Django's admin app (display and filter)\n\n## Requirements\n\n* Python 3.6+\n* Django 2.2+\n\n## Usage\n\n```py\nfrom enum import IntEnum\nfrom django.db import models\nfrom django_intenum import IntEnumField\n\n\nclass Status(IntEnum):\n\tUNKNOWN = 0\n\tIN_PROGRESS = 1\n\tCOMPLETED = 2\n\tERROR = 3\n\n\nclass Job(models.Model):\n\tstatus = IntEnumField(enum=Status)\n```\n\n## License\n\nThis project is licensed under the MIT license. The full license text is\navailable in the LICENSE file.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An IntEnumField for Django",
"version": "1.5.0",
"project_urls": {
"Homepage": "https://github.com/HearthSim/django-intenumfield",
"Repository": "https://github.com/HearthSim/django-intenumfield"
},
"split_keywords": [
"django",
"intenum"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b521201771d664cd42f21dc2df36885b69a89f63350dfa75248c1b2b9e79f3e9",
"md5": "fce29c10a68b8e7466cfb354274877c0",
"sha256": "f88f068e7d15872fdf9f8f7d29ea700ab765ed67cf2cd79f3c3602e24a36ef73"
},
"downloads": -1,
"filename": "django_intenumfield-1.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fce29c10a68b8e7466cfb354274877c0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6,<4.0",
"size": 3202,
"upload_time": "2023-05-25T09:25:28",
"upload_time_iso_8601": "2023-05-25T09:25:28.416025Z",
"url": "https://files.pythonhosted.org/packages/b5/21/201771d664cd42f21dc2df36885b69a89f63350dfa75248c1b2b9e79f3e9/django_intenumfield-1.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a86dff04c0aeae3e89c17e85fb0055db663afd0cfc8179f75b0184ba15c5b512",
"md5": "df9876675dfb4a96faec9a566fd4004a",
"sha256": "4298774f52aa975cdc6cd21392c3d731018bf151f0d9b42bfdf414204e87d55d"
},
"downloads": -1,
"filename": "django_intenumfield-1.5.0.tar.gz",
"has_sig": false,
"md5_digest": "df9876675dfb4a96faec9a566fd4004a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6,<4.0",
"size": 2672,
"upload_time": "2023-05-25T09:25:30",
"upload_time_iso_8601": "2023-05-25T09:25:30.222461Z",
"url": "https://files.pythonhosted.org/packages/a8/6d/ff04c0aeae3e89c17e85fb0055db663afd0cfc8179f75b0184ba15c5b512/django_intenumfield-1.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-25 09:25:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HearthSim",
"github_project": "django-intenumfield",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "django-intenumfield"
}