distribusi-verse: medium-tech web app content management system for the web
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.

24 lines
513 B

"""Form object declaration."""
from flask_wtf import FlaskForm
from wtforms import BooleanField, SubmitField
class AdminDistribusiForm(FlaskForm):
"""Admin Distribusi form."""
delete = SubmitField("Delete")
def distribusi_list_form_builder(distribusis):
class DistribusiListForm(AdminDistribusiForm):
pass
for i, distribusi in enumerate(distribusis):
setattr(
DistribusiListForm,
f"distribusi_{i}",
BooleanField(label=distribusi.distribusiname),
)
return DistribusiListForm()