forked from crunk/distribusi-verse
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
627 B
29 lines
627 B
"""Form object declaration."""
|
|
from flask_wtf import FlaskForm
|
|
from wtforms import (
|
|
SubmitField,
|
|
BooleanField,
|
|
)
|
|
|
|
|
|
class AdminUserForm(FlaskForm):
|
|
"""Admin Userform form."""
|
|
|
|
def user_list_form_builder(users):
|
|
class UserListForm(AdminUserForm):
|
|
pass
|
|
|
|
for (i, user) in enumerate(users):
|
|
setattr(
|
|
UserListForm,
|
|
f"user_{i}",
|
|
BooleanField(label=user.email),
|
|
)
|
|
|
|
return UserListForm()
|
|
|
|
tutors = SubmitField("Are tutors")
|
|
|
|
nottutors = SubmitField("Are not tutors")
|
|
|
|
delete = SubmitField("Delete")
|
|
|