fix: add model for MasterSuperDepartment
This commit is contained in:
parent
310a261b48
commit
cb6ed15eb8
|
@ -169,6 +169,25 @@ class Store(Base):
|
|||
return self.description or ""
|
||||
|
||||
|
||||
class MasterSuperDepartment(Base):
|
||||
"""
|
||||
A department may belong to more than one superdepartment, but has
|
||||
one "master" superdepartment. This avoids duplicating rows in
|
||||
some reports. By convention, a department's "master"
|
||||
superdepartment is the one with the lowest superID.
|
||||
"""
|
||||
__tablename__ = 'MasterSuperDepts'
|
||||
|
||||
super_id = sa.Column('superID', sa.Integer(), primary_key=True, autoincrement=False, nullable=False)
|
||||
|
||||
department_id = sa.Column('dept_ID', sa.Integer(), primary_key=True, autoincrement=False, nullable=False)
|
||||
|
||||
super_name = sa.Column(sa.String(length=50), nullable=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.super_name or ""
|
||||
|
||||
|
||||
class SuperDepartment(Base):
|
||||
"""
|
||||
Represents a "super" (parent/child) department mapping.
|
||||
|
|
Loading…
Reference in a new issue