Cleanup processs

This commit is contained in:
2025-04-25 15:12:07 +02:00
parent 5e4b1acca0
commit 8d0d9c4321
4 changed files with 4 additions and 1 deletions

3
application/api/views.py Normal file
View File

@@ -0,0 +1,3 @@
from flask import Blueprint
api_blueprint = Blueprint('api', )

32
application/models.py Normal file
View 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