def create_page_preview(self):
    if (self.pk is None):
        identifier = ('parent_id=%d;page_type=%s' % (self.get_parent().pk, self._meta.label))
    else:
        identifier = ('id=%d' % self.pk)
    return PagePreview.objects.create(token=self.get_preview_signer().sign(identifier), content_type=self.content_type, content_json=self.to_json())
def create_page_preview(self):
    if (self.pk is None):
        identifier = ('parent_id=%d;page_type=%s' % (self.get_parent().pk, self._meta.label))
    else:
        identifier = ('id=%d' % self.pk)
    return PagePreview.objects.create(token=self.get_preview_signer().sign(identifier), content_type=self.content_type, content_json=self.to_json())