Reputation: 468
I have a class based view in a model. And I want to access it from a view method.
class GetAjaxViewUser():
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
And this is in a model. And, I want to access it from a view method, something like this:
def AjaxView(request):
return GetAjaxViewUser.as_view()
Upvotes: 0
Views: 90
Reputation: 1204
You can access cbv from another method like
return GetAjaxViewUser.as_view()(request)
But I wonder what would you want to achieve by this?
Upvotes: 2