printedparts stage 1: scaffold, no AssetType, manifest per spec
Some checks failed
CI / backend (push) Failing after 1m38s
CI / naming (push) Successful in 1s
CI / frontend (push) Successful in 7s
CI / migrations-mysql (push) Failing after 8s

flask plugin new output, minus the scaffold's AssetType seeding:
printed parts are quantity-based consumables, not ADR-001 assets.
on_install seeds the three plugin settings instead. Manifest pins
core >=0.11.0, depends on employees (badge name resolution), ships
disabled until a site opts in.
This commit is contained in:
cproudlock
2026-07-16 16:44:54 -04:00
parent a0b92f7b5e
commit 8dd1fadeca
16 changed files with 843 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
"""Printedparts plugin models."""
from .printedparts import Printedparts
__all__ = ['Printedparts']

View File

@@ -0,0 +1,32 @@
"""Printedparts model.
This is an Asset extension table keyed by assetid. The Asset row holds
the platform fields (assetnumber, name, vendorid, locationid, etc.);
this table holds the printedparts-specific fields. Replace the example fields
below with your domain model.
"""
from shopdb.api import db, BaseModel
class Printedparts(BaseModel):
"""Printedparts domain entity, extending Asset by assetid."""
__tablename__ = 'printedparts'
assetid = db.Column(
db.Integer,
db.ForeignKey('assets.assetid', ondelete='CASCADE'),
primary_key=True,
)
# TODO: replace these example fields with your domain fields.
examplefield = db.Column(db.String(255), nullable=True)
asset = db.relationship('Asset', backref=db.backref('printedparts', uselist=False))
def to_dict(self):
return {
'assetid': self.assetid,
'examplefield': self.examplefield,
}