from datetime import date from flask_wtf import Form from wtforms import BooleanField, RadioField, StringField, SubmitField from wtforms.fields.html5 import DateField from wtforms.validators import Email, InputRequired, Length, Optional, Required class MembershipForm(Form): username = StringField( "Username", validators=[InputRequired("This field is required!"), Length(max=255)], ) email = StringField( "E-Mail", validators=[InputRequired("This field is required!"), Email()] ) fullname = StringField( "Full Name", validators=[InputRequired("This field is required!"), Length(max=65536)], ) membership = RadioField( "Membership Plan", validators=[InputRequired("Please select one of the options!")], choices=[ ("regular", "Regular membership (120€/year)"), ("student", "Student membership (40€/year)"), ( "supporting", "Supporting membership (40€/year) - Membership without voting rights", ), ("starving", "Starving Hacker - Get in touch with us at info@c3l.lu"), ], ) payment = RadioField( "Payment Options", validators=[InputRequired("Please select one of the options!")], choices=[ ("cash", "by cash"), ("wire transfer", "by wire transfer"), ("digicash", "by DigiCash"), ("bitcoin", "by bitcoin"), ("ethereum", "by ethereum"), ], ) street = StringField( "Nr., Street", validators=[Length(max=4000)], ) zip = StringField( "Postal Code", validators=[Length(max=30)], ) city = StringField( "City/Town", validators=[Length(max=500)], ) state = StringField( "State/County/Province", validators=[Length(max=500)], ) country = StringField( "Country", validators=[Length(max=500)], ) gpg = StringField( "GPG-ID", validators=[Optional(), Length(max=18)], ) jabber = StringField("Jabber Handle", validators=[Optional(), Email()]) twitter = StringField("Twitter Handle", validators=[Optional()]) terms = BooleanField( ( "By submitting this membership application, you agree to have read and understood " 'the statutes of the Chaos Computer Club Lëtzebuerg A.S.B.L.' ), validators=[InputRequired()], ) minor_member = BooleanField( ( "I am under 18 years of age and have the approval of my legal representative." ), ) submit = SubmitField("Become a member")