# drf-dropdown
![GitHub](https://img.shields.io/github/license/earthpyy/drf-dropdown)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/earthpyy/drf-dropdown/ci.yaml?branch=main)
![PyPI](https://img.shields.io/pypi/v/drf-dropdown)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/drf-dropdown)
![Pre-commit Enabled](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)
Dropdown population implementation for Django REST Framework
## Usage
### Add `DropdownView` to API URL
```python
# urls.py
import dropdown
urlpatterns = [
...
path('dropdown/', dropdown.DropdownView.as_view(), name='dropdown'),
]
```
### Define new dropdown
```python
# someapp/dropdown.py
import dropdown
@dropdown.register
def users(query='', **kwargs):
return dropdown.from_model(User, label_field='email')
```
## Development
### Set Up
```bash
make setup
```
Raw data
{
"_id": null,
"home_page": "https://github.com/earthpyy/drf-dropdown",
"name": "drf-dropdown",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "django,restframework,drf,dropdown",
"author": "Preeti Yuankrathok",
"author_email": "preetisatit@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7d/43/0f2eae530add38c4daedcbbb6a3b3f5782de236651267a23820b19d90125/drf_dropdown-0.4.1.tar.gz",
"platform": null,
"description": "# drf-dropdown\n\n![GitHub](https://img.shields.io/github/license/earthpyy/drf-dropdown)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/earthpyy/drf-dropdown/ci.yaml?branch=main)\n![PyPI](https://img.shields.io/pypi/v/drf-dropdown)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/drf-dropdown)\n![Pre-commit Enabled](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)\n\nDropdown population implementation for Django REST Framework\n\n## Usage\n\n### Add `DropdownView` to API URL\n\n```python\n# urls.py\nimport dropdown\n\nurlpatterns = [\n ...\n path('dropdown/', dropdown.DropdownView.as_view(), name='dropdown'),\n]\n```\n\n### Define new dropdown\n\n```python\n# someapp/dropdown.py\nimport dropdown\n\n@dropdown.register\ndef users(query='', **kwargs):\n return dropdown.from_model(User, label_field='email')\n```\n\n## Development\n\n### Set Up\n\n```bash\nmake setup\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Dropdown population implementation for Django REST Framework",
"version": "0.4.1",
"split_keywords": [
"django",
"restframework",
"drf",
"dropdown"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a2a21eda9a6b11f2c3508e740f99a95d4cbc81be6915a67ec992e05e039f7340",
"md5": "81e4e3f751dccbb882468cd53356c6aa",
"sha256": "23eaccc9a844a568564c33c925deecf3de4be317a498947cd0135a1c64796d60"
},
"downloads": -1,
"filename": "drf_dropdown-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "81e4e3f751dccbb882468cd53356c6aa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 7805,
"upload_time": "2023-01-06T06:23:34",
"upload_time_iso_8601": "2023-01-06T06:23:34.742160Z",
"url": "https://files.pythonhosted.org/packages/a2/a2/1eda9a6b11f2c3508e740f99a95d4cbc81be6915a67ec992e05e039f7340/drf_dropdown-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7d430f2eae530add38c4daedcbbb6a3b3f5782de236651267a23820b19d90125",
"md5": "1225bc5a20493e035ded61624fc7c2b6",
"sha256": "d9b0c17891b888a7b18674db56e639b7d62cfb0beef5ef0c8b6dfebe04b74f2c"
},
"downloads": -1,
"filename": "drf_dropdown-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "1225bc5a20493e035ded61624fc7c2b6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 6204,
"upload_time": "2023-01-06T06:23:35",
"upload_time_iso_8601": "2023-01-06T06:23:35.956350Z",
"url": "https://files.pythonhosted.org/packages/7d/43/0f2eae530add38c4daedcbbb6a3b3f5782de236651267a23820b19d90125/drf_dropdown-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-06 06:23:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "earthpyy",
"github_project": "drf-dropdown",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "drf-dropdown"
}