<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def post(self, request, *args, **kwargs):
 """ Method for handling POST requests. Deletes the object. Successful deletes are logged. Returns a 'render redirect' to the result of the `get_done_url` method. If a ProtectedError is raised, the `render` method is called with message explaining the error added to the context as `protected`. """


        self.object = self.get_object()
        msg = None
        if request.POST.get('delete'):
            try:
                with transaction.commit_on_success():
                    self.log_action(self.object, CMSLog.DELETE)
                    msg = "%s deleted" % self.object
                    self.object.delete()
            except ProtectedError, e:
                protected = []
                for x in e.protected_objects:
                    if hasattr(x, 'delete_blocked_message'):
                        protected.append(x.delete_blocked_message())
                    else:
                        protected.append(u"%s: %s" % (x._meta.verbose_name, x))
                return self.render(request, obj=self.object,
                                   protected=protected)

        return self.render(request, redirect_url=self.get_done_url(),
                           obj=self.object,
                           message=msg,
                           collect_render_data=False)