Writer beginnings

This commit is contained in:
lwark
2025-07-08 12:17:32 -05:00
parent 0472afd9a5
commit 432854e76f
12 changed files with 141 additions and 129 deletions

View File

@@ -35,8 +35,8 @@ class SampleChecker(QDialog):
self.channel = QWebChannel()
self.channel.registerObject('backend', self)
# NOTE: Used to maintain javascript functions.
template = env.get_template("sample_checker.html")
template_path = Path(template.environment.loader.__getattribute__("searchpath")[0])
# template = env.get_template("sample_checker.html")
# template_path = Path(template.environment.loader.__getattribute__("searchpath")[0])
# with open(template_path.joinpath("css", "styles.css"), "r") as f:
# css = [f.read()]
try:

View File

@@ -472,6 +472,10 @@ class SubmissionFormWidget(QWidget):
self.missing: bool = value['missing']
except (TypeError, KeyError):
self.missing: bool = True
try:
self.location: dict|None = value['location']
except (TypeError, KeyError):
self.location: dict|None = None
if self.input is not None:
layout.addWidget(self.label)
layout.addWidget(self.input)
@@ -501,7 +505,7 @@ class SubmissionFormWidget(QWidget):
value = self.input.date().toPyDate()
case _:
return None, None
return self.input.objectName(), dict(value=value, missing=self.missing)
return self.input.objectName(), dict(value=value, missing=self.missing, location=self.location)
def set_widget(self, parent: QWidget, key: str, value: dict,
submission_type: str | SubmissionType | None = None,
@@ -518,6 +522,7 @@ class SubmissionFormWidget(QWidget):
Returns:
QWidget: Form object
"""
if isinstance(submission_type, str):
submission_type = SubmissionType.query(name=submission_type)
if sub_obj is None:
@@ -843,6 +848,7 @@ class ClientSubmissionFormWidget(SubmissionFormWidget):
value = getattr(self, item)
info[item] = value
for k, v in info.items():
logger.debug(f"Setting pyd {k} to {v}")
self.pyd.__setattr__(k, v)
report.add_result(report)
return report