Exemplo n.º 1
0
class RecipeBooks(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    name = db.Column(db.String(80))
    steps = db.relationship('RecipeBookSteps',
                            backref='RecipeBooks',
                            lazy='dynamic',
                            cascade="all, delete-orphan")
Exemplo n.º 2
0
class Fermenter(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(80))
    brewname = db.Column(db.String(80))
    sensorid = db.Column(db.Integer())
    hydrometerid = db.Column(db.Integer())
    heaterid = db.Column(db.Integer())
    heateroffset_min = db.Column(db.Float())
    heateroffset_max = db.Column(db.Float())
    coolerid = db.Column(db.Integer())
    cooleroffset_min = db.Column(db.Float())
    cooleroffset_max = db.Column(db.Float())
    fanid = db.Column(db.Integer())
    target_temp = db.Column(db.Integer())
    steps = db.relationship('FermenterStep',
                            backref='Fermenter',
                            lazy='joined',
                            cascade="all, delete-orphan",
                            order_by="FermenterStep.order")

    def __repr__(self):
        return self.name

    def __unicode__(self):
        return self.name