pir_pipeline.utils.dashboard_utils.QuestionLinker¶
- class pir_pipeline.utils.dashboard_utils.QuestionLinker(data: dict, db: SQLAlchemyUtils, log: bool = True)¶
Bases:
object
QuestionLinker class to handle linking and unlinking of questions
- __init__(data: dict, db: SQLAlchemyUtils, log: bool = True)¶
QuestionLinker object to handle linking and unlinking of questions
- Args:
- data (dict): A series of instructions for linking/unlinking questions.
Should be of the form: {
- record_id_1: {
“link_type”: link or unlink, “base_question_id”: qid_1, “base_uqid”: uqid_1, “match_question_id”: qid_2, “match_uqid”: uqid_2
- record_id_n: {
…
}
}
db (SQLAlchemyUtils): SQLAlchemyUtils object for database interactions log (bool): Boolean to determin whether to write to changelog. Defaults to True.
Methods
__init__
(data, db[, log])QuestionLinker object to handle linking and unlinking of questions
confirm
()Mark a question as confirmed
get_ids
()Return the ids from the present record
link
()Link two questions
log
(changes)unlink
()Unlink two questions
Update links
- confirm()¶
Mark a question as confirmed
- get_ids()¶
Return the ids from the present record
- link()¶
Link two questions
- unlink()¶
Unlink two questions
- update_links()¶
Update links
Makes calles to QuestionLinker.link and QuestionLinker.unlink as needed