summaryrefslogtreecommitdiff
path: root/app/modules/ferti/forms.py
blob: d926931d5e8cd515d8bdc37e0199982e913c8715 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from flask_wtf import FlaskForm
from wtforms import (
    SubmitField,
    SelectField,
    HiddenField,
    StringField,
    PasswordField,
    IntegerField,
    FloatField,
    BooleanField,
    DateTimeField,
)
from wtforms.validators import InputRequired, Length, NumberRange


class AddFertiLog(FlaskForm):
    target = SelectField(
        "Type",
        choices=[("False", "Log"), ("True", "Target")],
        validators=[InputRequired()],
    )
    nno3 = FloatField("NNO3", default=0)
    p = FloatField("P", default=0)
    k = FloatField("K", default=0)
    ca = FloatField("Ca", default=0)
    mg = FloatField("Mg", default=0)
    s = FloatField("S", default=0)
    na = FloatField("Na", default=0)
    cl = FloatField("Cl", default=0)
    fe = FloatField("Fe", default=0)
    zn = FloatField("Zn", default=0)
    b = FloatField("B", default=0)
    mn = FloatField("Mn", default=0)
    cu = FloatField("Cu", default=0)
    mo = FloatField("Mo", default=0)
    si = FloatField("Si", default=0)
    nnh4 = FloatField("NNH4", default=0)
    submit = SubmitField("Add/Update Log")


class AddFertiTarget(AddFertiLog):
    targeted_log = SelectField(
        "Log to target",
        choices=[("value1", "Last"), ("value2", "Named")],
        validators=[InputRequired()],
    )
    submit = SubmitField("Add/Update Log")
Copyright 2019--2024 Marius PETER