Parsing: Add the 'content' attribute

Add the 'content' attribute to documents to allow access
to a document's parsed content for indexing and other purposes.

Fixes the document parsing indexing failing test.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-11-27 05:24:55 -04:00
parent aaf9f7a8be
commit 5a626861ae
4 changed files with 18 additions and 5 deletions

View File

@@ -14,6 +14,11 @@ def get_document_content(document):
try:
page_content = page.content.content
except DocumentPageContent.DoesNotExist:
pass
yield ''
else:
yield conditional_escape(force_text(page_content))
@property
def document_property_content(self):
return ' '.join(get_document_content(self))