forked from crunk/distribusi-verse
28 lines
580 B
Python
28 lines
580 B
Python
"""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")
|
|
|
|
delete = SubmitField("Delete")
|