View raw

1 # -*- mode: python; -*- 2 3 """Form class attribute names must match model class attribute names 4 for proper request.form dictionary splatting. 5 6 """ 7 8 from .customers.forms import AddCustomer 9 from .ferti.forms import AddFertiLog, AddFertiTarget 10 from .invoices.forms import AddInvoice 11 from .products.forms import AddProduct 12 13 14 # class AddUser(FlaskForm): 15 # customer_id = SelectField("Customer", choices=[]) 16 # invoice_id_alt = StringField("Alternative invoice ID") 17 # customer_reference = StringField("Customer reference") 18 # date_billed = DateField('Date billed', format='%Y-%m-%d') 19 # date_due = DateField('Date due', format='%Y-%m-%d') 20 # amount_net = FloatField("Amount without tax", default=0) 21 # amount_gross = FloatField("Amount with tax", default=0) 22 # amount_tax = FloatField("Amount of tax", default=0) 23 # submit = SubmitField("Add Invoice") 24 25 # def __init__(self, **kwargs): 26 # super().__init__() 27 # self.customer_id.choices = [ 28 # (cus.primary_key, cus.name) for cus in Customer.query.all() 29 # ] 30 31