distribusi-verse/verse/forms/adminuserform.py

28 lines
580 B
Python
Raw Normal View History

2022-03-20 11:24:33 +01:00
"""Form object declaration."""
from flask_wtf import FlaskForm
from wtforms import (
SubmitField,
BooleanField,
2022-03-20 11:24:33 +01:00
)
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")
2022-03-20 11:24:33 +01:00
delete = SubmitField("Delete")