Skip to content

Commit

Permalink
coreutils.restful.metabases: Split each class into a file.
Browse files Browse the repository at this point in the history
  • Loading branch information
espenak committed Jul 25, 2011
1 parent fed10db commit 45e3e34
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
49 changes: 4 additions & 45 deletions devilry/coreutils/restful/metabases/__init__.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,4 @@
class AssignmentExtjsModelMeta:
""" Metadata for Assignment javascript. """
combobox_fieldgroups = ['subject', 'period']
combobox_tpl = ('<div class="important">{parentnode__parentnode__short_name}.{parentnode__short_name}.{short_name}</div>'
'<div class="unimportant">{long_name}</div>')
combobox_displayfield = 'short_name'

class AssignmentGroupExtjsModelMeta:
""" Metadata for AssignmentGroup javascript. """
combobox_fieldgroups = ['assignment', 'period', 'subject']
combobox_tpl = ('<div class="important">Group id: {id}'
#'<tpl for="candidates__identifier">, {.}</tpl>'
'</div>'
'<div class="unimportant">'
'{parentnode__parentnode__parentnode__short_name}.'
'{parentnode__parentnode__short_name}.'
'{parentnode__short_name}</div>')
combobox_displayfield = 'id'

class DeadlineExtjsModelMeta:
""" Metadata for Deadline javascript. """
combobox_fieldgroups = ['assignment', 'period', 'subject']
combobox_tpl = ('<div class="important">{deadline:date}</div>'
'<div class="unimportant">'
'{assignment_group__parentnode__parentnode__parentnode__short_name}.'
'{assignment_group__parentnode__parentnode__short_name}.'
'{assignment_group__parentnode__short_name}'
'&mdash; Group id: {assignment_group}</div>')
combobox_displayfield = 'id'


class DeliveryExtjsModelMeta:
""" Metadata for Delivery javascript. """
combobox_fieldgroups = ['assignment', 'period', 'subject',
'assignment_group']
combobox_tpl = ('<div class="important">Delivery: {number} '
'<tpl if="deadline__assignment_group__name"> &ndash; {deadline__assignment_group__name}</tpl>'
#'<tpl for="deadline__assignment_group__candidates__identifier">, {.}</tpl>'
'</div>'
'<div class="unimportant">'
'{deadline__assignment_group__parentnode__parentnode__parentnode__short_name}.'
'{deadline__assignment_group__parentnode__parentnode__short_name}.'
'{deadline__assignment_group__parentnode__short_name} '
'&mdash; Group id: {deadline__assignment_group}</div>')
combobox_displayfield = 'id'
from assignment import AssignmentExtjsModelMeta
from assignment_group import AssignmentGroupExtjsModelMeta
from deadline import DeadlineExtjsModelMeta
from delivery import DeliveryExtjsModelMeta
6 changes: 6 additions & 0 deletions devilry/coreutils/restful/metabases/assignment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AssignmentExtjsModelMeta:
""" Metadata for Assignment javascript. """
combobox_fieldgroups = ['subject', 'period']
combobox_tpl = ('<div class="important">{parentnode__parentnode__short_name}.{parentnode__short_name}.{short_name}</div>'
'<div class="unimportant">{long_name}</div>')
combobox_displayfield = 'short_name'
11 changes: 11 additions & 0 deletions devilry/coreutils/restful/metabases/assignment_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AssignmentGroupExtjsModelMeta:
""" Metadata for AssignmentGroup javascript. """
combobox_fieldgroups = ['assignment', 'period', 'subject']
combobox_tpl = ('<div class="important">Group id: {id}'
#'<tpl for="candidates__identifier">, {.}</tpl>'
'</div>'
'<div class="unimportant">'
'{parentnode__parentnode__parentnode__short_name}.'
'{parentnode__parentnode__short_name}.'
'{parentnode__short_name}</div>')
combobox_displayfield = 'id'
10 changes: 10 additions & 0 deletions devilry/coreutils/restful/metabases/deadline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class DeadlineExtjsModelMeta:
""" Metadata for Deadline javascript. """
combobox_fieldgroups = ['assignment', 'period', 'subject']
combobox_tpl = ('<div class="important">{deadline:date}</div>'
'<div class="unimportant">'
'{assignment_group__parentnode__parentnode__parentnode__short_name}.'
'{assignment_group__parentnode__parentnode__short_name}.'
'{assignment_group__parentnode__short_name}'
'&mdash; Group id: {assignment_group}</div>')
combobox_displayfield = 'id'
14 changes: 14 additions & 0 deletions devilry/coreutils/restful/metabases/delivery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class DeliveryExtjsModelMeta:
""" Metadata for Delivery javascript. """
combobox_fieldgroups = ['assignment', 'period', 'subject',
'assignment_group']
combobox_tpl = ('<div class="important">Delivery: {number} '
'<tpl if="deadline__assignment_group__name"> &ndash; {deadline__assignment_group__name}</tpl>'
#'<tpl for="deadline__assignment_group__candidates__identifier">, {.}</tpl>'
'</div>'
'<div class="unimportant">'
'{deadline__assignment_group__parentnode__parentnode__parentnode__short_name}.'
'{deadline__assignment_group__parentnode__parentnode__short_name}.'
'{deadline__assignment_group__parentnode__short_name} '
'&mdash; Group id: {deadline__assignment_group}</div>')
combobox_displayfield = 'id'

0 comments on commit 45e3e34

Please sign in to comment.