diff --git a/devilry/coreutils/restful/metabases/__init__.py b/devilry/coreutils/restful/metabases/__init__.py index 9be2bea79a..588205167f 100644 --- a/devilry/coreutils/restful/metabases/__init__.py +++ b/devilry/coreutils/restful/metabases/__init__.py @@ -1,45 +1,4 @@ -class AssignmentExtjsModelMeta: - """ Metadata for Assignment javascript. """ - combobox_fieldgroups = ['subject', 'period'] - combobox_tpl = ('
{parentnode__parentnode__short_name}.{parentnode__short_name}.{short_name}
' - '
{long_name}
') - combobox_displayfield = 'short_name' - -class AssignmentGroupExtjsModelMeta: - """ Metadata for AssignmentGroup javascript. """ - combobox_fieldgroups = ['assignment', 'period', 'subject'] - combobox_tpl = ('
Group id: {id}' - #', {.}' - '
' - '
' - '{parentnode__parentnode__parentnode__short_name}.' - '{parentnode__parentnode__short_name}.' - '{parentnode__short_name}
') - combobox_displayfield = 'id' - -class DeadlineExtjsModelMeta: - """ Metadata for Deadline javascript. """ - combobox_fieldgroups = ['assignment', 'period', 'subject'] - combobox_tpl = ('
{deadline:date}
' - '
' - '{assignment_group__parentnode__parentnode__parentnode__short_name}.' - '{assignment_group__parentnode__parentnode__short_name}.' - '{assignment_group__parentnode__short_name}' - '— Group id: {assignment_group}
') - combobox_displayfield = 'id' - - -class DeliveryExtjsModelMeta: - """ Metadata for Delivery javascript. """ - combobox_fieldgroups = ['assignment', 'period', 'subject', - 'assignment_group'] - combobox_tpl = ('
Delivery: {number} ' - ' – {deadline__assignment_group__name}' - #', {.}' - '
' - '
' - '{deadline__assignment_group__parentnode__parentnode__parentnode__short_name}.' - '{deadline__assignment_group__parentnode__parentnode__short_name}.' - '{deadline__assignment_group__parentnode__short_name} ' - '— Group id: {deadline__assignment_group}
') - combobox_displayfield = 'id' +from assignment import AssignmentExtjsModelMeta +from assignment_group import AssignmentGroupExtjsModelMeta +from deadline import DeadlineExtjsModelMeta +from delivery import DeliveryExtjsModelMeta diff --git a/devilry/coreutils/restful/metabases/assignment.py b/devilry/coreutils/restful/metabases/assignment.py new file mode 100644 index 0000000000..dcda50cc9e --- /dev/null +++ b/devilry/coreutils/restful/metabases/assignment.py @@ -0,0 +1,6 @@ +class AssignmentExtjsModelMeta: + """ Metadata for Assignment javascript. """ + combobox_fieldgroups = ['subject', 'period'] + combobox_tpl = ('
{parentnode__parentnode__short_name}.{parentnode__short_name}.{short_name}
' + '
{long_name}
') + combobox_displayfield = 'short_name' diff --git a/devilry/coreutils/restful/metabases/assignment_group.py b/devilry/coreutils/restful/metabases/assignment_group.py new file mode 100644 index 0000000000..afe3be2a5c --- /dev/null +++ b/devilry/coreutils/restful/metabases/assignment_group.py @@ -0,0 +1,11 @@ +class AssignmentGroupExtjsModelMeta: + """ Metadata for AssignmentGroup javascript. """ + combobox_fieldgroups = ['assignment', 'period', 'subject'] + combobox_tpl = ('
Group id: {id}' + #', {.}' + '
' + '
' + '{parentnode__parentnode__parentnode__short_name}.' + '{parentnode__parentnode__short_name}.' + '{parentnode__short_name}
') + combobox_displayfield = 'id' diff --git a/devilry/coreutils/restful/metabases/deadline.py b/devilry/coreutils/restful/metabases/deadline.py new file mode 100644 index 0000000000..783f29263d --- /dev/null +++ b/devilry/coreutils/restful/metabases/deadline.py @@ -0,0 +1,10 @@ +class DeadlineExtjsModelMeta: + """ Metadata for Deadline javascript. """ + combobox_fieldgroups = ['assignment', 'period', 'subject'] + combobox_tpl = ('
{deadline:date}
' + '
' + '{assignment_group__parentnode__parentnode__parentnode__short_name}.' + '{assignment_group__parentnode__parentnode__short_name}.' + '{assignment_group__parentnode__short_name}' + '— Group id: {assignment_group}
') + combobox_displayfield = 'id' diff --git a/devilry/coreutils/restful/metabases/delivery.py b/devilry/coreutils/restful/metabases/delivery.py new file mode 100644 index 0000000000..220d8ac930 --- /dev/null +++ b/devilry/coreutils/restful/metabases/delivery.py @@ -0,0 +1,14 @@ +class DeliveryExtjsModelMeta: + """ Metadata for Delivery javascript. """ + combobox_fieldgroups = ['assignment', 'period', 'subject', + 'assignment_group'] + combobox_tpl = ('
Delivery: {number} ' + ' – {deadline__assignment_group__name}' + #', {.}' + '
' + '
' + '{deadline__assignment_group__parentnode__parentnode__parentnode__short_name}.' + '{deadline__assignment_group__parentnode__parentnode__short_name}.' + '{deadline__assignment_group__parentnode__short_name} ' + '— Group id: {deadline__assignment_group}
') + combobox_displayfield = 'id'