MCPcopy
hub / github.com/django/django / post

Method post

django/views/generic/edit.py:250–260  ·  view source on GitHub ↗
(self, request, *args, **kwargs)

Source from the content-addressed store, hash-verified

248 form_class = Form
249
250 def post(self, request, *args, **kwargs):
251 # Set self.object before the usual form processing flow.
252 # Inlined because having DeletionMixin as the first base, for
253 # get_success_url(), makes leveraging super() with ProcessFormView
254 # overly complex.
255 self.object = self.get_object()
256 form = self.get_form()
257 if form.is_valid():
258 return self.form_valid(form)
259 else:
260 return self.form_invalid(form)
261
262 def form_valid(self, form):
263 success_url = self.get_success_url()

Callers

nothing calls this directly

Calls 5

form_validMethod · 0.95
form_invalidMethod · 0.80
get_objectMethod · 0.45
get_formMethod · 0.45
is_validMethod · 0.45

Tested by

no test coverage detected