Skip to content

urls

formatting.urls ¤

Attributes¤

app_name = 'formatting' module-attribute ¤

urlpatterns = [path('extension/<int:pk>', ExtensionDetailView.as_view(), name='extension_detail'), path('delimiter/<int:pk>', DelimiterDetailView.as_view(), name='delimiter_detail'), path('date/<int:pk>', DateDetailView.as_view(), name='date_detail'), path('time/<int:pk>', TimeDetailView.as_view(), name='time_detail'), path('format/<int:pk>', FormatDetailView.as_view(), name='format_detail'), path('classification/<int:pk>', ClassificationDetailView.as_view(), name='classification_detail'), path('extension/create/', ExtensionCreateView.as_view(), name='extension_create'), path('delimiter/create/', DelimiterCreateView.as_view(), name='delimiter_create'), path('date/create/', DateCreateView.as_view(), name='date_create'), path('time/create/', TimeCreateView.as_view(), name='time_create'), path('format/create/', FormatCreateView.as_view(), name='format_create'), path('classification/create/', ClassificationCreateView.as_view(), name='classification_create'), path('extension/edit/<int:pk>', ExtensionEditView.as_view(), name='extension_edit'), path('delimiter/edit/<int:pk>', DelimiterEditView.as_view(), name='delimiter_edit'), path('date/edit/<int:pk>', DateEditView.as_view(), name='date_edit'), path('time/edit/<int:pk>', TimeEditView.as_view(), name='time_edit'), path('format/edit/<int:pk>', FormatEditView.as_view(), name='format_edit'), path('classification/edit/<int:pk>', ClassificationEditView.as_view(), name='classification_edit'), path('date/delete/<int:pk>', DateDeleteView.as_view(), name='date_delete'), path('delimiter/delete/<int:pk>', DelimiterDeleteView.as_view(), name='delimiter_delete'), path('extension/delete/<int:pk>', ExtensionDeleteView.as_view(), name='extension_delete'), path('format/delete/<int:pk>', FormatDeleteView.as_view(), name='format_delete'), path('time/delete/<int:pk>', TimeDeleteView.as_view(), name='time_delete'), path('classification/delete/<int:pk>', ClassificationDeleteView.as_view(), name='classification_delete'), path('extension/', ExtensionListView.as_view(), name='extension_list'), path('delimiter/', DelimiterListView.as_view(), name='delimiter_list'), path('date/', DateListView.as_view(), name='date_list'), path('time/', TimeListView.as_view(), name='time_list'), path('format/', FormatListView.as_view(), name='format_list'), path('classification/', ClassificationListView.as_view(), name='classification_list')] module-attribute ¤

Classes¤

ClassificationCreateView ¤

Bases: CustomCreateView

View to create a classification.

ClassificationDeleteView ¤

Bases: CustomDeleteView

View to delete a classification.

ClassificationDetailView ¤

Bases: CustomDetailView

View to view a classification.

ClassificationEditView ¤

Bases: CustomEditView

View to edit a classification.

ClassificationListView ¤

Bases: CustomTableView

View to list all classifications.

DateCreateView ¤

Bases: CustomCreateView

View to create a date.

DateDeleteView ¤

Bases: CustomDeleteView

View to delete a date.

DateDetailView ¤

Bases: CustomDetailView

View to view a date.

DateEditView ¤

Bases: CustomEditView

View to edit a date.

DateListView ¤

Bases: CustomTableView

View to list all dates.

DelimiterCreateView ¤

Bases: CustomCreateView

View to create a delimiter.

DelimiterDeleteView ¤

Bases: CustomDeleteView

View to delete a delimiter.

DelimiterDetailView ¤

Bases: CustomDetailView

View to view a delimiter.

DelimiterEditView ¤

Bases: CustomEditView

View to edit a delimiter.

DelimiterListView ¤

Bases: CustomTableView

View to list all delimiters.

ExtensionCreateView ¤

Bases: CustomCreateView

View to create a extension.

ExtensionDeleteView ¤

Bases: CustomDeleteView

View to delete a extension.

ExtensionDetailView ¤

Bases: CustomDetailView

View to view a extension.

ExtensionEditView ¤

Bases: CustomEditView

View to edit a extension.

ExtensionListView ¤

Bases: CustomTableView

View to list all extensions.

FormatCreateView ¤

Bases: CustomCreateView

View to create a format.

FormatDeleteView ¤

Bases: CustomDeleteView

View to delete a format.

FormatDetailView ¤

Bases: CustomDetailView

View to view a format.

Functions¤
get_inline() ¤

Return the inline data for the format.

If provided, this method should return a dictionary with the inline data to be shown in the detail view. The dictionary should have the following keys:

  • title: Title of the inline data.
  • header: List with the header of the table.
  • objects: List with the objects to be shown in the table. Each object should be a list with the same length as the header.

Returns:

Type Description
dict | None

dict | None: Inline data for the format.

Source code in formatting\views.py
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
def get_inline(self) -> dict | None:
    """Return the inline data for the format.

    If provided, this method should return a dictionary with the inline data to be
    shown in the detail view. The dictionary should have the following keys:

    - title: Title of the inline data.
    - header: List with the header of the table.
    - objects: List with the objects to be shown in the table. Each object should be
        a list with the same length as the header.

    Returns:
        dict | None: Inline data for the format.
    """
    objects = [
        [
            linkify(obj.pk, "formatting:classification_detail", obj.pk),
            obj.value,
            obj.variable.name,
            linkify(
                obj.variable.pk,
                "variable:variable_detail",
                obj.variable.variable_code,
            ),
            linkify(
                obj.variable.unit.pk, "variable:unit_detail", obj.variable.unit
            ),
        ]
        for obj in self.object.classification_set.all()
    ]
    return {
        "title": "Classifications",
        "header": ["Id", "Column", "Variable", "Code", "Unit"],
        "objects": objects,
    }

FormatEditView ¤

Bases: CustomEditView

View to edit a format.

FormatListView ¤

Bases: CustomTableView

View to list all formats.

TimeCreateView ¤

Bases: CustomCreateView

View to create a time.

TimeDeleteView ¤

Bases: CustomDeleteView

View to delete a time.

TimeDetailView ¤

Bases: CustomDetailView

View to view a time.

TimeEditView ¤

Bases: CustomEditView

View to edit a time.

TimeListView ¤

Bases: CustomTableView

View to list all times.