def _fill_system_fields_to_python_values(document: Document, field_to_python_values: Dict[str, List]): field_to_python_values[FIELD_CODE_DOC_ID] = document.id field_to_python_values[FIELD_CODE_DOC_NAME] = document.name field_to_python_values[FIELD_CODE_DOC_TITLE] = document.title field_to_python_values[FIELD_CODE_IS_REVIEWED] = document.is_reviewed() field_to_python_values[FIELD_CODE_IS_COMPLETED] = document.is_completed() field_to_python_values[FIELD_CODE_DOC_FULL_TEXT] = \ document.full_text[:settings.RAW_DB_FULL_TEXT_SEARCH_CUT_ABOVE_TEXT_LENGTH] if document.full_text else None field_to_python_values[FIELD_CODE_DOC_FULL_TEXT_LENGTH] = len( document.full_text) if document.full_text else 0 project = document.project field_to_python_values[ FIELD_CODE_PROJECT_ID] = project.pk if project is not None else None field_to_python_values[ FIELD_CODE_PROJECT_NAME] = project.name if project is not None else None field_to_python_values[FIELD_CODE_ASSIGNEE_ID] = document.assignee_id field_to_python_values[ FIELD_CODE_ASSIGNEE_NAME] = document.assignee.get_full_name( ) if document.assignee else None field_to_python_values[FIELD_CODE_CREATE_DATE] = document.history.last( ).history_date field_to_python_values[FIELD_CODE_ASSIGN_DATE] = document.assign_date field_to_python_values[ FIELD_CODE_STATUS_NAME] = document.status.name if document.status else None
def _fill_system_fields_to_python_values(document: Document, field_to_python_values: Dict[str, List]): field_to_python_values[_FIELD_CODE_DOC_ID] = [document.id] field_to_python_values[_FIELD_CODE_DOC_NAME] = [document.name] field_to_python_values[_FIELD_CODE_DOC_TITLE] = [document.title] field_to_python_values[_FIELD_CODE_IS_REVIEWED] = [document.is_reviewed()] field_to_python_values[_FIELD_CODE_DOC_FULL_TEXT] = \ [document.full_text[:settings.RAW_DB_FULL_TEXT_SEARCH_CUT_ABOVE_TEXT_LENGTH] if document.full_text else None] field_to_python_values[_FIELD_CODE_DOC_FULL_TEXT_LENGTH] = [ len(document.full_text) if document.full_text else 0 ] field_to_python_values[_FIELD_CODE_PROJECT_ID] = [document.project_id] field_to_python_values[_FIELD_CODE_ASSIGNEE_NAME] = [ document.assignee.get_full_name() if document.assignee else None ] field_to_python_values[_FIELD_CODE_STATUS_NAME] = [ document.status.name if document.status else None ]