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 validators, permission classes, and PermissionTestModel fo… #9567

Closed
wants to merge 4 commits into from

Conversation

Ghosts6
Copy link

@Ghosts6 Ghosts6 commented Oct 19, 2024

This pull request introduces new custom validators, permission classes, and a test model 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 PermissionTestModel for permission test cases.

All changes have been tested, and all tests pass.

@browniebroke
Copy link
Member

According to our contributing page:

At this point in its lifespan we consider Django REST framework to be feature-complete. We focus on pull requests that track the continued development of Django versions, and generally do not accept new features or code formatting changes.

This is clearly a new feature, so no thank you.

PS: it would work nicely in a 3rd party package

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.

3 participants