Changeset - c045aabadc16
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2019-07-29 19:23:05
ledgar@techsupport.coop
Add data model for `Parameter`
1 file changed with 21 insertions and 0 deletions:
0 comments (0 inline, 0 general) First comment
corepos/db/model.py
Show inline comments
 
@@ -36,6 +36,27 @@ from sqlalchemy.ext.associationproxy import association_proxy
 
Base = declarative_base()
 

	
 

	
 
@six.python_2_unicode_compatible
 
class Parameter(Base):
 
    """
 
    Represents a "parameter" value.
 
    """
 
    __tablename__ = 'parameters'
 

	
 
    store_id = sa.Column(sa.SmallInteger(), primary_key=True, nullable=False)
 

	
 
    lane_id = sa.Column(sa.SmallInteger(), primary_key=True, nullable=False)
 

	
 
    param_key = sa.Column(sa.String(length=100), primary_key=True, nullable=False)
 

	
 
    param_value = sa.Column(sa.String(length=255), nullable=True)
 

	
 
    is_array = sa.Column(sa.Boolean(), nullable=True)
 

	
 
    def __str__(self):
 
        return "{}-{} {}".format(self.store_id, self.lane_id, self.param_key)
 

	
 

	
 
@six.python_2_unicode_compatible
 
class Department(Base):
 
    """
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now