<s> from __future__ import unicode_literals <EOL> from datetime import date <EOL> from wtforms import ( <EOL> Form , <EOL> validators , <EOL> TextField , <EOL> PasswordField , <EOL> SelectField , <EOL> HiddenField , <EOL> ) <EOL> __all__ = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def months ( ) : <EOL> return [ <EOL> ( str ( i ) , str ( i ) ) for i in range ( <NUM_LIT:1> , <NUM_LIT> ) <EOL> ] <EOL> def years ( min = None , max = None ) : <EOL> if not min : <EOL> min = date . today ( ) . year <EOL> if not max : <EOL> max = date . today ( ) . year + <NUM_LIT:10> <EOL> return [ <EOL> ( str ( i ) , str ( i ) ) for i in range ( min , max ) <EOL> ] <EOL> class CreditCardForm ( Form ) : <EOL> """<STR_LIT>""" <EOL> number = TextField ( '<STR_LIT>' , [ validators . Required ( ) ] ) <EOL> expiration_month = SelectField ( '<STR_LIT>' , [ validators . Required ( ) ] , <EOL> choices = months ( ) ) <EOL> expiration_year = SelectField ( '<STR_LIT>' , [ validators . Required ( ) ] , <EOL> choices = years ( ) ) <EOL> cvv = TextField ( '<STR_LIT>' , [ validators . Required ( ) ] ) <EOL> class PurchaseForm ( CreditCardForm ) : <EOL> """<STR_LIT>""" <EOL> name = HiddenField ( validators = [ validators . Required ( ) ] ) <EOL> email = HiddenField ( validators = [ validators . Required ( ) , <EOL> validators . Email ( ) ] ) <EOL> card_href = HiddenField ( validators = [ validators . Required ( ) ] ) <EOL> class GuestPurchaseForm ( PurchaseForm ) : <EOL> name = TextField ( '<STR_LIT:Name>' , [ validators . Required ( ) ] ) <EOL> email = TextField ( '<STR_LIT>' , [ validators . Required ( ) , <EOL> validators . Email ( ) ] ) <EOL> class ListingForm ( Form ) : <EOL> """<STR_LIT>""" <EOL> type = HiddenField ( default = '<STR_LIT>' ) <EOL> listing_id = HiddenField ( ) <EOL> name = HiddenField ( ) <EOL> email = HiddenField ( ) <EOL> line1 = TextField ( '<STR_LIT>' , [ validators . Required ( ) ] ) <EOL> postal_code = TextField ( '<STR_LIT>' , [ validators . Required ( ) ] ) <EOL> phone = TextField ( '<STR_LIT>' , [ validators . Required ( ) ] ) <EOL> country_code = HiddenField ( default = '<STR_LIT>' ) <EOL> state = HiddenField ( ) <EOL> dob_month = SelectField ( '<STR_LIT>' , <EOL> [ validators . Required ( ) ] , choices = months ( ) ) <EOL> dob_year = SelectField ( '<STR_LIT>' , [ validators . Required ( ) ] , <EOL> choices = years ( <NUM_LIT> , date . today ( ) . year - <NUM_LIT> ) ) <EOL> class GuestListingForm ( ListingForm ) : <EOL> """<STR_LIT>""" <EOL> name = TextField ( '<STR_LIT:Name>' , [ validators . Required ( ) ] ) <EOL> email = TextField ( '<STR_LIT>' , [ validators . Required ( ) , <EOL> validators . Email ( ) ] ) </s>
