Skip to main content

Dropdown population implementation for Django REST Framework

Project description

drf-dropdown

GitHub GitHub Workflow Status PyPI PyPI - Python Version Pre-commit Enabled

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 details)

Uploaded Source

Built Distribution

drf_dropdown-0.4.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file drf_dropdown-0.4.1.tar.gz.

File metadata

  • Download URL: drf_dropdown-0.4.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.15 Linux/5.15.0-1024-azure

File hashes

Hashes for drf_dropdown-0.4.1.tar.gz
Algorithm Hash digest
SHA256 d9b0c17891b888a7b18674db56e639b7d62cfb0beef5ef0c8b6dfebe04b74f2c
MD5 1225bc5a20493e035ded61624fc7c2b6
BLAKE2b-256 7d430f2eae530add38c4daedcbbb6a3b3f5782de236651267a23820b19d90125

See more details on using hashes here.

File details

Details for the file drf_dropdown-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: drf_dropdown-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.15 Linux/5.15.0-1024-azure

File hashes

Hashes for drf_dropdown-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23eaccc9a844a568564c33c925deecf3de4be317a498947cd0135a1c64796d60
MD5 81e4e3f751dccbb882468cd53356c6aa
BLAKE2b-256 a2a21eda9a6b11f2c3508e740f99a95d4cbc81be6915a67ec992e05e039f7340

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page