Utils¶
Module contents¶
General utilities.
Submodules¶
django_dicom.utils.html module¶
Definition of the Html
class.
-
django_dicom.utils.html.
ADMIN_VIEW_NAMES
= {'DataElement': 'admin:django_dicom_dataelement_change', 'DataElementDefinition': 'admin:django_dicom_dataelementdefinition_change', 'DataElementValue': 'admin:django_dicom_dataelementvalue_change', 'Header': 'admin:django_dicom_header_change', 'Image': 'admin:django_dicom_image_change', 'Patient': 'admin:django_dicom_patient_change', 'Series': 'admin:django_dicom_series_change', 'Study': 'admin:django_dicom_study_change'}¶ Admin site views by model name, used to generate the appropriate URLs.
-
class
django_dicom.utils.html.
Html
¶ Bases:
object
Automates some HTML generation for the admin site.
-
BREAK
= '<br>'¶
-
HORIZONTAL_LINE
= '<hr style="background-color: {color};">'¶
-
classmethod
admin_link
(model_name: str, pk: int, text: str = None) → str¶ Returns a link to the admin site page of the provided model instance.
Parameters: Returns: HTML link
Return type:
-
classmethod
break_html
(pieces) → str¶ Add break (<br>) tags between an iterable of HTML snippets.
Parameters: pieces (Iterable) – HTML snippets Returns: Joined HTML Return type: str
-