Dropdown population implementation for Django REST Framework
Project description
drf-dropdown
Dropdown population implementation for Django REST Framework
Usage
Add DropdownView
to API URL
# urls.py
import dropdown
urlpatterns = [
...
path('dropdown/', dropdown.DropdownView.as_view(), name='dropdown'),
]
Define new dropdown
# someapp/dropdown.py
import dropdown
@dropdown.register
def users(query='', **kwargs):
return dropdown.from_model(User, label_field='email')
Development
Set Up
make setup
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
drf_dropdown-0.4.1.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for drf_dropdown-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23eaccc9a844a568564c33c925deecf3de4be317a498947cd0135a1c64796d60 |
|
MD5 | 81e4e3f751dccbb882468cd53356c6aa |
|
BLAKE2b-256 | a2a21eda9a6b11f2c3508e740f99a95d4cbc81be6915a67ec992e05e039f7340 |