Manually Calling A Class Based Generic View
I'm currently trying to call a class based Generic view from within another class based generic view and cant seem to do it correctly. Ways I've tried: result = CategoryTypes.as_vi
Solution 1:
The first way -- CategoryTypes.as_view()(self.request)
-- is right. The problem is that if your view returns a TemplateResponse
, its render
method isn't called automatically.
So if you need to access the content of the response, call render()
on it first.
Post a Comment for "Manually Calling A Class Based Generic View"