django_baseline/views.py
def form_valid(self, form):
        """
        Calls pre and post save hooks.
        """
        self.object = form.save(commit=False)

        # Invoke pre_save hook, and allow it to abort the saving
        # process and do a redirect.
        response = self.pre_save(self.object)
        if response:
            return response

        self.object.save()
        form.save_m2m()
        self.post_save(self.object)

        return HttpResponseRedirect(self.get_success_url())
def form_valid(self, form):
        """
        Calls pre and post save hooks.
        """
        self.object = form.save(commit=False)

        # Invoke pre_save hook, and allow it to abort the saving
        # process and do a redirect.
        response = self.pre_save(self.object)
        if response:
            return response

        self.object.save()
        form.save_m2m()
        self.post_save(self.object)

        return HttpResponseRedirect(self.get_success_url())
Calls pre and post save hooks.