classy class based views code example
Example 1: Class based views
'function' object has no attribute 'as_view'
Example 2: cbv uk django
def form_valid(self, form):
"""If the form is valid, save the associated model."""
self.object = form.save()
return super().form_valid(form)