1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-04 22:40:30 +00:00

Show only part of part_student in StudentView

This commit is contained in:
Mo 2022-06-30 17:13:43 +02:00
parent 872ce5dcc1
commit a8eee63b9e
2 changed files with 7 additions and 1 deletions

View file

@ -40,6 +40,7 @@ from .admin_link_formatters import (
group_formatter,
part_formatter,
part_student_formatter,
part_student_part_formatter,
part_with_semester_formatter,
program_formatter,
semester_experiment_formatter,
@ -423,7 +424,7 @@ class StudentView(SecureAdminModelView):
column_formatters = {
"uni_email": email_formatter,
"contact_email": email_formatter,
"part_students": part_student_formatter,
"part_students": part_student_part_formatter,
}
form_excluded_columns = [

View file

@ -5,6 +5,11 @@ def str_without_semester_attr_formatter(attr):
return attr.str_without_semester()
def part_student_part_attr_formatter(attr):
return attr.part
part_student_part_formatter = link_formatter_factory("admin_part_student", part_student_part_attr_formatter)
part_student_formatter = link_formatter_factory("admin_part_student")
student_formatter = link_formatter_factory("admin_student")