def emit_page(self, index, text): """Emit a plain text page.""" record = DocumentRecord() record.document_id = self.document.id record.text = safe_string(text) record.index = index db.session.add(record)
def create_page(self, document, text, number=1): record = DocumentRecord() record.document_id = document.id record.text = text record.index = number db.session.add(record) return record
def emit_page(self, index, text): """Emit a plain text page.""" self.document.type = Document.TYPE_TEXT record = DocumentRecord() record.document_id = self.document.id record.text = text record.index = index db.session.add(record)
def emit_page(self, index, text): """Emit a plain text page.""" text = stringify(text) record = DocumentRecord() record.document_id = self.document.id record.text = text record.index = index db.session.add(record) if text is not None: self.pages.append(text)