drf-dropdown
Dropdown population implementation for Django REST Framework
Usage
DropdownView
to API URL
Add # 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