'Utility method to mark the attached object of this placeholder
(if any) as dirty.
This allows us to know when the content in this placeholder
has been changed.'

def mark_as_dirty(self, language, clear_cache=True):

    from cms.models import Page, StaticPlaceholder, Title
    if clear_cache:
        self.clear_cache(language)
    attached_model = self._get_attached_model()
    if (attached_model is Page):
        Title.objects.filter(page=self.page, language=language).update(publisher_state=PUBLISHER_STATE_DIRTY)
    elif (attached_model is StaticPlaceholder):
        StaticPlaceholder.objects.filter(draft=self).update(dirty=True)
