mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Add link formatters
This commit is contained in:
parent
5e59f0fe72
commit
d1a38d0fb0
1 changed files with 42 additions and 0 deletions
42
advlabdb/admin_link_formatters.py
Normal file
42
advlabdb/admin_link_formatters.py
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
from .advlabdb_independent_funs import link_formatter_factory
|
||||||
|
|
||||||
|
|
||||||
|
def str_without_semester_attr_formatter(attr):
|
||||||
|
return attr.str_without_semester()
|
||||||
|
|
||||||
|
|
||||||
|
part_student_formatter = link_formatter_factory("admin_part_student")
|
||||||
|
|
||||||
|
student_formatter = link_formatter_factory("admin_student")
|
||||||
|
|
||||||
|
part_formatter = link_formatter_factory("admin_part", str_without_semester_attr_formatter)
|
||||||
|
part_with_semester_formatter = link_formatter_factory("admin_part")
|
||||||
|
|
||||||
|
group_formatter = link_formatter_factory("admin_group", str_without_semester_attr_formatter)
|
||||||
|
|
||||||
|
experiment_mark_formatter = link_formatter_factory("admin_experiment_mark")
|
||||||
|
|
||||||
|
program_formatter = link_formatter_factory("admin_program")
|
||||||
|
|
||||||
|
group_experiment_formatter = link_formatter_factory("admin_group_experiment")
|
||||||
|
|
||||||
|
semester_experiment_formatter = link_formatter_factory("admin_semester_experiment", str_without_semester_attr_formatter)
|
||||||
|
semester_experiment_with_semester_formatter = link_formatter_factory("admin_semester_experiment")
|
||||||
|
|
||||||
|
|
||||||
|
def appointment_attr_formatter(attr):
|
||||||
|
return attr.date
|
||||||
|
|
||||||
|
|
||||||
|
appointment_date_formatter = link_formatter_factory("admin_appointment", appointment_attr_formatter)
|
||||||
|
appointment_formatter = link_formatter_factory("admin_appointment")
|
||||||
|
|
||||||
|
assistant_formatter = link_formatter_factory("admin_assistant")
|
||||||
|
|
||||||
|
admin_formatter = link_formatter_factory("admin_admin")
|
||||||
|
|
||||||
|
experiment_formatter = link_formatter_factory("admin_experiment")
|
||||||
|
|
||||||
|
semester_formatter = link_formatter_factory("admin_semester")
|
||||||
|
|
||||||
|
user_formatter = link_formatter_factory("admin_user")
|
Loading…
Reference in a new issue