added rest-API, sqlalchemy and nice structure
This commit is contained in:
10
models/example_model.py
Normal file
10
models/example_model.py
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
class Sensor(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||
mac = db.Column(db.String(32), nullable=False, unique=True, index=True)
|
||||
uuid = db.Column(db.String(36), nullable=False, unique=True, index=True, default=str(uuid.uuid4()))
|
||||
tags = db.relationship("SensorTag", secondary=sensor_tag_relations, back_populates="sensors")
|
||||
rough_geo_location = db.Column(db.String, nullable=True, index=True)
|
||||
name = db.Column(db.String(128), default="<not set>", nullable=False, index=True, unique=False)
|
||||
description = db.Column(db.String(4096), nullable=True, unique=False)
|
||||
Reference in New Issue
Block a user