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.1.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

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