def __init__(self, serializer, serializer_cls, permission_classes=None): ModelView.__init__(self, serializer=serializer, serializer_cls=serializer_cls, permission_classes=permission_classes, endpoint=endpoints.Endpoint(endpoints.Param, 'delete'))
def __init__(self, property_name: str, model_cls, permission_classes=None): self.model_cls = model_cls self.property_name = property_name View.__init__(self, permission_classes=permission_classes, endpoint=endpoints.Endpoint( endpoints.Param, underscore_to_dash(property_name)))
def __init__( self, func: Callable, model_serializer_cls: Type[serializers.ModelSerializer] = None, arg_serializer_cls: Type[serializers.Serializer] = None, permission_classes=None, **serializer_fields: serializers.Field): """ Parameters ---------- func : The function that executes the logic for this ModelMethodView. model_serializer_cls : The `rest_framework` `ModelSerializer` class used to serialize instances of this ModelMethodView's model. arg_serializer_cls : The `rest_framework` serializer class used to serialize arguments for the `func` of this ModelMethodView. permission_classes : Optional permission classes to apply to view function. """ self.model_serializer_cls = model_serializer_cls MethodViewBase.__init__(self, func=func, arg_serializer_cls=arg_serializer_cls, permission_classes=permission_classes, endpoint=endpoints.Endpoint( underscore_to_dash(func.__name__), endpoints.Param), **serializer_fields)
def __init__(self, func: Callable, arg_serializer_cls: Type[serializers.Serializer] = None, permission_classes=None, **serializer_fields: serializers.Field): self.model_type_cls = None MethodViewBase.__init__(self, func=func, arg_serializer_cls=arg_serializer_cls, permission_classes=permission_classes, endpoint=endpoints.Endpoint( underscore_to_dash(func.__name__)), **serializer_fields)
def __init__(self, serializer, serializer_cls, permission_classes=None): ModelView.__init__(self, serializer=serializer, serializer_cls=serializer_cls, permission_classes=permission_classes, endpoint=endpoints.Endpoint('get-or-create'))