Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom field validators and permission classes with tests #9566

Closed
wants to merge 1 commit into from
Closed

Add custom field validators and permission classes with tests #9566

wants to merge 1 commit into from

Conversation

Ghosts6
Copy link

@Ghosts6 Ghosts6 commented Oct 19, 2024

This pull request introduces new custom validators and permission classes to Django REST Framework:

  • Added AlphabeticFieldValidator to validate alphabetic characters and spaces.
  • Added AlphanumericFieldValidator to validate alphanumeric characters.
  • Added CustomLengthValidator to enforce string length limits.
  • Added IsAdminUserOrReadOnly permission class to allow only admin users to modify objects.
  • Added IsOwner permission class to allow object owners to edit their own objects.
  • Added test cases for all new validators and permissions.

These changes enhance DRF’s flexibility in handling field validation and permissions. The code has been tested, and all tests pass.

@Ghosts6 Ghosts6 closed this Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant