summaryrefslogtreecommitdiff
path: root/app/modules/forms.py
blob: 001557ad76f6a1f930c110ad610df5b82f01e4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- mode: python; -*-

"""Form class attribute names must match model class attribute names
for proper request.form dictionary splatting.

"""

from .customers.forms import AddCustomer
from .ferti.forms import AddFertiLog, AddFertiTarget
from .invoices.forms import AddInvoice
from .products.forms import AddProduct


# class AddUser(FlaskForm):
#     customer_id = SelectField("Customer", choices=[])
#     invoice_id_alt = StringField("Alternative invoice ID")
#     customer_reference = StringField("Customer reference")
#     date_billed = DateField('Date billed', format='%Y-%m-%d')
#     date_due = DateField('Date due', format='%Y-%m-%d')
#     amount_net = FloatField("Amount without tax", default=0)
#     amount_gross = FloatField("Amount with tax", default=0)
#     amount_tax = FloatField("Amount of tax", default=0)
#     submit = SubmitField("Add Invoice")

#     def __init__(self, **kwargs):
#         super().__init__()
#         self.customer_id.choices = [
#             (cus.primary_key, cus.name) for cus in Customer.query.all()
#         ]

Copyright 2019--2024 Marius PETER