Example #1
0
class Alert(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    event_type = db.Column(db.String(200))
    event_start = db.Column(db.DateTime, default=datetime.utcnow())
    location = db.Column(db.String(200))
    alert_msg = db.Column(db.String(400))

    @property
    def serialize(self):
        return {
            'event_type': self.event_type,
            'event_start': dump_datetime(self.event_start),
            'location': self.location,
            'alert_msg': self.alert_msg
        }
Example #2
0
class Address(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    town = db.Column(db.String(100))
    street = db.Column(db.String(200))
    flat_number = db.Column(db.Integer)
    longitude = db.Column(db.REAL)
    latitude = db.Column(db.REAL)
    user_id = db.Column(db.Integer, db.ForeignKey(User.id))
Example #3
0
class Event(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    event_start = db.Column(db.DateTime)
    event_duration = db.Column(db.Integer)
    flow = db.Column(db.Float)
    price = db.Column(db.Float)
    event_type = db.Column(db.String(100))
Example #4
0
class GroupUsers(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey(User.id)),
    group_id = db.Column(db.Integer, db.ForeignKey(Group.id))
Example #5
0
class Group(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    group_name = db.Column(db.String(100))
    group_description = db.Column(db.String(200))