Skip to main content

A small validator for params in drf view actions

Project description

drf-params-validator

This is a simple package to validate request params on DRF viewset's actions.

usage

  • Install the package to your project
pip install drf-action-params-validator
  • Use the decorator to return 400 when one of given parameter is missing
from drf_action_params_validator import validate_request_params

@action(detail=True, methods=[METHOD_POST])
@validate_request_params(params=['param_name_1', 'param_name_2'])
def test_action(self, request, pk):
    pass

release notes

v 0.0.1

POST data validation, default error message

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-action-params-validator-0.0.4.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drf_action_params_validator-0.0.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file drf-action-params-validator-0.0.4.tar.gz.

File metadata

  • Download URL: drf-action-params-validator-0.0.4.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.6

File hashes

Hashes for drf-action-params-validator-0.0.4.tar.gz
Algorithm Hash digest
SHA256 48ab5890c385dd7951f9da577424936abf3888bff8b60741c39a2d9e38f516d5
MD5 1de0f901130ef683ac701095fd25c888
BLAKE2b-256 cf341595f2af4c45c46dbad0692e8c13796682d752168f212e33bde77938cc83

See more details on using hashes here.

File details

Details for the file drf_action_params_validator-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: drf_action_params_validator-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.6

File hashes

Hashes for drf_action_params_validator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4d84e25de10a428069d536f66595920f9c5f95dbdccafb1f7bbdc0f6413053fb
MD5 d980bda95e380d8dbf713413c08d5b29
BLAKE2b-256 41f563438aa4644698a4d2203f6ec83b1b1a660280d54115ea002d2ce4623bc6

See more details on using hashes here.

Supported by

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