mirror of
https://github.com/StefBuwalda/ProjectIOT.git
synced 2025-10-30 11:19:57 +00:00
Numberplate shows on Dash
Added logs.html for the logs page Changed dashboard.html so the numberplates show on the dashboard Moved models.py to to the dashboard folder
This commit is contained in:
32
application/dashboard/models.py
Normal file
32
application/dashboard/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