Bug fixes to templating issues.
This commit is contained in:
@@ -26,7 +26,7 @@ from openpyxl.worksheet.worksheet import Worksheet
|
||||
from openpyxl.drawing.image import Image as OpenpyxlImage
|
||||
from tools import row_map, setup_lookup, jinja_template_loading, rreplace, row_keys, check_key_or_attr, Result, Report
|
||||
from datetime import datetime, date
|
||||
from typing import List, Any, Tuple, Literal, Generator
|
||||
from typing import List, Any, Tuple, Literal
|
||||
from dateutil.parser import parse
|
||||
from pathlib import Path
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
@@ -1295,16 +1295,6 @@ class BacterialCulture(BasicSubmission):
|
||||
output['controls'] = [item.to_sub_dict() for item in self.controls]
|
||||
return output
|
||||
|
||||
# @classmethod
|
||||
# def get_regex(cls) -> str:
|
||||
# """
|
||||
# Retrieves string for regex construction.
|
||||
#
|
||||
# Returns:
|
||||
# str: string for regex construction
|
||||
# """
|
||||
# return "(?P<Bacterial_Culture>RSL(?:-|_)?BC(?:-|_)?20\d{2}-?\d{2}-?\d{2}(?:(_|-)?\d?([^_0123456789\sA-QS-Z]|$)?R?\d?)?)"
|
||||
|
||||
@classmethod
|
||||
def filename_template(cls):
|
||||
"""
|
||||
@@ -1491,16 +1481,6 @@ class Wastewater(BasicSubmission):
|
||||
outstr = super().enforce_name(instr=instr, data=data)
|
||||
return outstr
|
||||
|
||||
# @classmethod
|
||||
# def get_regex(cls) -> str:
|
||||
# """
|
||||
# Retrieves string for regex construction
|
||||
#
|
||||
# Returns:
|
||||
# str: String for regex construction
|
||||
# """
|
||||
# return "(?P<Wastewater>RSL(?:-|_)?WW(?:-|_)?20\d{2}-?\d{2}-?\d{2}(?:(_|-)?\d?([^_0123456789\sA-QS-Z]|$)?R?\d?)?)"
|
||||
|
||||
@classmethod
|
||||
def adjust_autofill_samples(cls, samples: List[Any]) -> List[Any]:
|
||||
"""
|
||||
@@ -1629,7 +1609,7 @@ class Wastewater(BasicSubmission):
|
||||
continue
|
||||
copy = dict(submitter_id=sample['submitter_id'], row=row, column=column)
|
||||
well_24.append(copy)
|
||||
input_dict['origin_plate'] = DocxWriter.create_plate_map(sample_list=well_24, rows=4, columns=6)
|
||||
input_dict['origin_plate'] = [item for item in DocxWriter.create_plate_map(sample_list=well_24, rows=4, columns=6)]
|
||||
return input_dict
|
||||
|
||||
|
||||
@@ -1911,16 +1891,6 @@ class WastewaterArtic(BasicSubmission):
|
||||
# logger.debug(f"Final EN name: {final_en_name}")
|
||||
return final_en_name
|
||||
|
||||
# @classmethod
|
||||
# def get_regex(cls) -> str:
|
||||
# """
|
||||
# Retrieves string for regex construction
|
||||
#
|
||||
# Returns:
|
||||
# str: string for regex construction.
|
||||
# """
|
||||
# return "(?P<Wastewater_Artic>(\\d{4}-\\d{2}-\\d{2}(?:-|_)(?:\\d_)?artic)|(RSL(?:-|_)?AR(?:-|_)?20\\d{2}-?\\d{2}-?\\d{2}(?:(_|-)\\d?(\\D|$)R?\\d?)?))"
|
||||
|
||||
@classmethod
|
||||
def finalize_parse(cls, input_dict: dict, xl: pd.ExcelFile | None = None, info_map: dict | None = None) -> dict:
|
||||
"""
|
||||
|
||||
@@ -172,6 +172,8 @@ class SubmissionDetails(QDialog):
|
||||
"""
|
||||
export_plate = BasicSubmission.query(rsl_plate_num=self.export_plate)
|
||||
base_dict = export_plate.to_dict(full_data=True)
|
||||
base_dict['excluded'] = export_plate.get_default_info('details_ignore')
|
||||
logger.debug(f"base dict: {pformat(base_dict)}")
|
||||
writer = DocxWriter(base_dict=base_dict)
|
||||
fname = select_save_file(obj=self, default_name=base_dict['plate_number'], extension="docx")
|
||||
writer.save(fname)
|
||||
|
||||
@@ -22,4 +22,7 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block signing_button %}
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
</body>
|
||||
@@ -66,6 +66,8 @@
|
||||
<h3><u>Plate map:</u></h3>
|
||||
<img height="600px" width="1300px" src="data:image/jpeg;base64,{{ sub['export_map'] | safe }}">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block signing_button %}
|
||||
{% if signing_permission %}
|
||||
<button type="button" id="sign_btn">Sign Off</button>
|
||||
{% endif %}
|
||||
@@ -82,8 +84,6 @@
|
||||
document.getElementById("{{ sample['submitter_id'] }}").addEventListener("click", function(){
|
||||
backend.sample_details("{{ sample['submitter_id'] }}");
|
||||
});
|
||||
{% endfor %}
|
||||
{% for sample in sub['samples'] %}
|
||||
document.getElementById("{{ sample['submitter_id'] }}_alpha").addEventListener("click", function(){
|
||||
backend.sample_details("{{ sample['submitter_id'] }}");
|
||||
});
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
{% block body %}
|
||||
<!--<button type="button" id="back_btn">Back</button>-->
|
||||
{% endblock %}
|
||||
{% block signing_button %}{% endblock %}
|
||||
</body>
|
||||
<script>
|
||||
{% block script %}
|
||||
|
||||
@@ -31,4 +31,7 @@
|
||||
{{ sub['origin_plate'] }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block signing_button %}
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
Binary file not shown.
@@ -35,4 +35,7 @@
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block signing_button %}
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user