<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_widget_content(sender, instance, **kwargs):
 """ delete the widget content instance when a WidgetContentModel is deleted """

    if not issubclass(sender, WidgetContentModel):
        return

    # delete WidgetContent Entry
    wcs = WidgetContent.objects.filter(
        content_pk=instance.pk,
        content_model=('%s' % instance.__class__).replace("<class '", '').replace("'>", ''))
    for wc in wcs:
        logger.debug('delete wc %r'%wc)
        wc.delete()