<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(self, *args, **kwargs):
 """ Triggers a task that will unpublish the object after it is deleted. Save with keyword argument obj.delete(unpublish=False) to skip it. """

        from bakery import tasks
        from django.contrib.contenttypes.models import ContentType
        # if obj.save(unpublish=False) has been passed, we skip the task.
        unpublish = kwargs.pop('unpublish', True)
        # Delete it from the database
        super(AutoPublishingBuildableModel, self).delete(*args, **kwargs)
        if unpublish:
            ct = ContentType.objects.get_for_model(self.__class__)
            tasks.unpublish_object.delay(ct.pk, self.pk)