mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #28999 -- Documented how to reverse a class-based view by instance.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
committed by
Sarah Boyce
parent
be138f32ed
commit
4d11ea1ef0
@@ -58,12 +58,12 @@ def bad_view(request, *args, **kwargs):
|
||||
raise ValueError("I don't think I'm getting good value for this view")
|
||||
|
||||
|
||||
class _HelloView(View):
|
||||
class HelloView(View):
|
||||
def get(self, request, *args, **kwargs):
|
||||
return HttpResponse(f"Hello {self.kwargs['name']}")
|
||||
|
||||
|
||||
view_func_from_cbv = _HelloView.as_view()
|
||||
view_func_from_cbv = HelloView.as_view()
|
||||
|
||||
empty_view_partial = partial(empty_view, template_name="template.html")
|
||||
empty_view_nested_partial = partial(
|
||||
|
||||
Reference in New Issue
Block a user