コード例 #1
0
ファイル: forms.py プロジェクト: GBodin/getopinionated
    def _additional_save_operations(self, amendmentproposal):
        ## create diff
        content = FullDocument.cleanText(self.cleaned_data["content"])
        newdiff = Diff.generateDiff(self.document.content, content)
        newdiff.fulldocument = self.document
        newdiff.save()

        ## add diff to amendmentproposal
        amendmentproposal.diff = newdiff
        return amendmentproposal
コード例 #2
0
ファイル: forms.py プロジェクト: GBodin/getopinionated
    def _additional_save_operations(self, amendmentproposal):
        ## create diff
        content = FullDocument.cleanText(self.cleaned_data["content"])
        newdiff = Diff.generateDiff(self.document.content, content)
        newdiff.fulldocument = self.document
        newdiff.save()

        ## add diff to amendmentproposal
        amendmentproposal.diff = newdiff
        return amendmentproposal
コード例 #3
0
ファイル: forms.py プロジェクト: GBodin/getopinionated
 def clean_content(self):
     content = self.cleaned_data["content"]
     content = sanitizehtml.sanitizeHtml(content)
     content = FullDocument.cleanText(content)
     return content
コード例 #4
0
ファイル: forms.py プロジェクト: GBodin/getopinionated
 def clean_content(self):
     content = self.cleaned_data["content"]
     content = sanitizehtml.sanitizeHtml(content)
     content = FullDocument.cleanText(content)
     return content