mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-30 03:09:58 +00:00
Cleanup processs
This commit is contained in:
3
application/api/views.py
Normal file
3
application/api/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from flask import Blueprint
|
||||
|
||||
api_blueprint = Blueprint('api', )
|
||||
32
application/models.py
Normal file
32
application/models.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from datetime import datetime
|
||||
from application import db
|
||||
|
||||
|
||||
# db classes
|
||||
class Plate(db.Model):
|
||||
__abstract__ = True
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
plate = db.Column(db.String(40), nullable=False)
|
||||
|
||||
|
||||
class LoggedItem(Plate):
|
||||
__tablename__ = "LoggedItems"
|
||||
dateLogged = db.Column(db.DateTime, nullable=False)
|
||||
allowed = db.Column(db.Boolean, nullable=False, server_default=db.false())
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
plate: str,
|
||||
datetime: datetime,
|
||||
allowed: bool = False,
|
||||
):
|
||||
self.plate = plate
|
||||
self.allowed = allowed
|
||||
self.dateLogged = datetime
|
||||
|
||||
|
||||
class AllowedPlate(Plate):
|
||||
__tablename__ = "AllowedPlates"
|
||||
|
||||
def __init__(self, plate: str):
|
||||
self.plate = plate
|
||||
Reference in New Issue
Block a user