Import mission profiles and better format text fields
This commit is contained in:
@@ -18,10 +18,10 @@ from ..custom.colortag import course_color
|
||||
|
||||
# Resource Class for Student data import
|
||||
class StudentResource(ModelResource):
|
||||
surname = fields.Field(attribute="surname", column_name="surname", widget=CharWidget())
|
||||
name = fields.Field(attribute="name", column_name="name", widget=CharWidget())
|
||||
email = fields.Field(attribute="email", column_name="email", widget=CharWidget())
|
||||
phone = fields.Field(attribute="phone", column_name="phone", widget=CharWidget())
|
||||
surname = fields.Field(attribute="surname", column_name="surname")
|
||||
name = fields.Field(attribute="name", column_name="name")
|
||||
email = fields.Field(attribute="email", column_name="email")
|
||||
phone = fields.Field(attribute="phone", column_name="phone")
|
||||
|
||||
# Cleanup fields before entering
|
||||
def before_import_row(self, row: dict[str, str], **kwargs) -> None:
|
||||
@@ -42,7 +42,7 @@ class StudentResource(ModelResource):
|
||||
class ChangeCourseForm(AdminActionForm):
|
||||
course = forms.ModelChoiceField(queryset=Course.objects.all())
|
||||
|
||||
class StudentAdmin(ImportMixin, AdminActionFormsMixin, admin.ModelAdmin):
|
||||
class StudentAdmin(ImportMixin, AdminActionFormsMixin, admin.ModelAdmin):
|
||||
list_display = ("surname", "name", "course", "course_color", "email", "phone", "password", "active")
|
||||
list_filter = ("course", "active")
|
||||
actions = ("change_course", "disable_students")
|
||||
|
||||
Reference in New Issue
Block a user