Flask + Vue rewrite of the classic-ASP shopdb, built as a plugin framework so sister GE Aerospace sites can adopt it. Product version 0.7.0-pre-0.8.0, plugin contract 0.11.0, 966 backend tests. Key entry points: - docs/INSTALL-WINDOWS-IIS.md - tested Windows + IIS install runbook (own-site and subpath deployment methods) - docs/PILOT-DEPLOY.md - production pilot: stand up + import + verify - docs/IMPORT-API.md - schema-agnostic legacy data import contract - scripts/site_imports/wjf/ - West Jefferson reference import loader - docs/adr/ - twelve accepted architecture decision records
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
"""Printer driver: a named link (SMB path or HTTP URL) to driver files."""
|
|
|
|
from shopdb.api import db
|
|
|
|
|
|
class PrinterDriver(db.Model):
|
|
__tablename__ = 'printerdrivers'
|
|
|
|
driverid = db.Column(db.Integer, primary_key=True)
|
|
name = db.Column(db.String(150), nullable=False)
|
|
# SMB path (\\\\server\\share\\...) or HTTP URL to the driver package
|
|
location = db.Column(db.String(500), nullable=False)
|
|
description = db.Column(db.Text)
|
|
# Optional: attach a driver to a specific printer model
|
|
modelnumberid = db.Column(
|
|
db.Integer,
|
|
db.ForeignKey('models.modelnumberid'),
|
|
nullable=True
|
|
)
|
|
isactive = db.Column(db.Boolean, default=True, nullable=False)
|
|
|
|
model = db.relationship('Model')
|
|
|
|
def to_dict(self):
|
|
return {
|
|
'driverid': self.driverid,
|
|
'name': self.name,
|
|
'location': self.location,
|
|
'description': self.description,
|
|
'modelnumberid': self.modelnumberid,
|
|
'modelname': self.model.modelnumber if self.model else None,
|
|
'isactive': bool(self.isactive),
|
|
}
|