示例#1
0
class AnimalForm(FlaskForm):
    id = IntegerField(label="ID(int)", validators=[DataRequired()])
    address = StringField(label="Address the zoo", validators=[DataRequired()])
    personal = StringField(label="Name personal", validators=[DataRequired()])
    box = IntegerField(label="Number the box", validators=[DataRequired()])
    animal = SelectField(label="Type the animal",
                         choices=[(i[0], i[0]) for i in get_classes()],
                         validators=[DataRequired()])
    nickname = StringField(label="Nickname the animal",
                           validators=[DataRequired()])
    eating = DateTimeField(label="Last time eat. format='%Y-%m-%d %H:%M:%S'",
                           validators=[DataRequired()])
    certificat = StringField(label="Certificat", validators=[DataRequired()])
    chip = BooleanField(label="is chip")
    submit = SubmitField('Submit')
示例#2
0
def classes_page(semester):
    if request.method == "GET":
        aclasses = database.get_classes(semester)
        return render_template("classes.html",
                               year=year_dec,
                               aclasses=aclasses[0],
                               instructors=aclasses[1],
                               zip=zip)
    elif request.method == "POST":
        if session.get('logged_in') is None:
            flash("You are not logged in", "danger")
            return redirect(url_for("login_page"))
        keys = request.form.getlist("class_keys")
        for key in keys:
            loaded = json.loads(key)
            database.delete_class(loaded[0], loaded[1])
        return redirect(url_for("classes_page", semester=semester))
 def __init__(self, size_divider=4):
     self.size_divider = size_divider
     self.ratio = 0.75
     classes = database.get_classes()
     super(Experiment, self).__init__(classes, *self.build_experiment(classes))
 def __init__(self, ratio=0.5):
     self.ratio = ratio
     classes = database.get_classes()
     super(Experiment, self).__init__(classes,
                                      *self.build_experiment(classes))
 def __init__(self, ratio=0.5):
     self.ratio = ratio
     classes = database.get_classes()
     super(Experiment, self).__init__(classes, *self.build_experiment(classes))
 def __init__(self, size_divider=4):
     self.size_divider = size_divider
     self.ratio = 0.75
     classes = database.get_classes()
     super(Experiment, self).__init__(classes,
                                      *self.build_experiment(classes))