From 08a062f654a9fd8c8ce83e5db5e81ce040af4363 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 18 Jul 2019 09:44:00 -0500 Subject: [PATCH] Add data model for ProductFlag --- corepos/db/model.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/corepos/db/model.py b/corepos/db/model.py index 9a03c0c..02aa313 100644 --- a/corepos/db/model.py +++ b/corepos/db/model.py @@ -281,6 +281,23 @@ class Product(Base): return self.description or '' +@six.python_2_unicode_compatible +class ProductFlag(Base): + """ + Represents a product flag attribute. + """ + __tablename__ = 'prodFlags' + + bit_number = sa.Column(sa.SmallInteger(), primary_key=True, autoincrement=False, nullable=False, default=0) + + description = sa.Column(sa.String(length=50), nullable=True) + + active = sa.Column(sa.Boolean(), nullable=True, default=True) + + def __str__(self): + return self.description or '' + + class Employee(Base): """ Represents an employee within the organization.