This commit is contained in:
Gilles Soulier
2026-01-05 16:08:01 +01:00
parent dcba044cd6
commit c67befc549
2215 changed files with 26743 additions and 329 deletions
+26
View File
@@ -0,0 +1,26 @@
"""
Linux BenchTools - Location Models
"""
from sqlalchemy import Column, Integer, String, Text
from app.db.base import BasePeripherals
class Location(BasePeripherals):
"""
Physical locations (rooms, closets, drawers, shelves)
Hierarchical structure for organizing peripherals
"""
__tablename__ = "locations"
id = Column(Integer, primary_key=True, index=True)
nom = Column(String(255), nullable=False, unique=True)
type = Column(String(50), nullable=False, index=True) # root, piece, placard, tiroir, etagere, meuble, boite
parent_id = Column(Integer, index=True) # Hierarchical relationship
description = Column(Text)
image_path = Column(String(500)) # Photo of the location
qr_code_path = Column(String(500)) # QR code for quick access
ordre_affichage = Column(Integer, default=0)
def __repr__(self):
return f"<Location(id={self.id}, nom='{self.nom}', type='{self.type}')>"