{"library":"rest-condition","title":"REST Condition","description":"Rest Condition provides a simple, declarative way to compose complex permission checks for Django REST Framework views using logical operators (&, |, ~). Current version is 1.0.3, with infrequent updates.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install rest-condition"],"cli":null},"imports":["from rest_condition import C, And, Or, Not","from rest_condition import And, Or, Not"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from rest_framework.permissions import IsAuthenticated\nfrom rest_condition import And, Or, Not\nfrom rest_framework.views import APIView\n\nclass MyView(APIView):\n    permission_classes = [And(IsAuthenticated, ~Or(IsAdmin, IsOwner))]\n    def get(self, request):\n        return Response({\"message\": \"Hello\"})","lang":"python","description":"Define a view with combined permission checks using logical operators. Placeholder permissions IsAdmin and IsOwner should be defined elsewhere.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}