distribusi-verse/verse/admin_page/forms/adminuserform.py

24 lines
526 B
Python
Raw Normal View History

2024-06-02 22:37:55 +02:00
"""Form object declaration."""
from flask_wtf import FlaskForm
from wtforms import BooleanField, SubmitField
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()
delete = SubmitField("Delete")