Currently the cbv check consists of an attribute check on the view function:
|
def is_cbv_view(func: Callable) -> bool: |
|
""" |
|
Determine if a function is a result of a CBV as_view() call. |
|
""" |
|
return hasattr(func, "view_class") |
This isn't compatible with DRF's views (via browsable API) because of the extra processing in DRF's APIView and ViewSetMixin; it is possible by checking the cls attribute but we need to make sure there aren't any side effects with other DRF things like the wrapped request/response objects.
Currently the cbv check consists of an attribute check on the view function:
django-cbv-inspect/cbv_inspect/utils.py
Lines 86 to 90 in fad3cc9
This isn't compatible with DRF's views (via browsable API) because of the extra processing in DRF's APIView and ViewSetMixin; it is possible by checking the
clsattribute but we need to make sure there aren't any side effects with other DRF things like the wrapped request/response objects.