Changeset - 9f19646f0856
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2019-07-23 19:44:11
ledgar@techsupport.coop
Cleanup attribute names for Department model
1 file changed with 13 insertions and 12 deletions:
0 comments (0 inline, 0 general) First comment
corepos/db/model.py
Show inline comments
 
@@ -43,34 +43,35 @@ class Department(Base):
 
    """
 
    __tablename__ = 'departments'
 

	
 
    dept_no = sa.Column(sa.SmallInteger(), primary_key=True, autoincrement=False, nullable=False)
 
    number = sa.Column('dept_no', sa.SmallInteger(), primary_key=True, autoincrement=False, nullable=False)
 

	
 
    dept_name = sa.Column(sa.String(length=30), nullable=True)
 
    name = sa.Column('dept_name', sa.String(length=30), nullable=True)
 

	
 
    dept_tax = sa.Column(sa.Boolean(), nullable=True)
 
    tax = sa.Column(sa.Boolean(), nullable=True)
 

	
 
    dept_fs = sa.Column(sa.Boolean(), nullable=True)
 
    food_stampable = sa.Column('dept_fs', sa.Boolean(), nullable=True)
 

	
 
    dept_limit = sa.Column(sa.Float(), nullable=True)
 
    limit = sa.Column('dept_limit', sa.Float(), nullable=True)
 

	
 
    dept_minimum = sa.Column(sa.Float(), nullable=True)
 
    minimum = sa.Column('dept_minimum', sa.Float(), nullable=True)
 

	
 
    dept_discount = sa.Column(sa.Boolean(), nullable=True)
 
    discount = sa.Column('dept_discount', sa.Boolean(), nullable=True)
 

	
 
    # TODO: probably should rename this attribute, but to what?
 
    dept_see_id = sa.Column(sa.Boolean(), nullable=True)
 

	
 
    modified = sa.Column(sa.DateTime(), nullable=True)
 

	
 
    modifiedby = sa.Column(sa.Integer(), nullable=True)
 
    modified_by_id = sa.Column('modifiedby', sa.Integer(), nullable=True)
 

	
 
    margin = sa.Column(sa.Float(), nullable=False, default=0)
 

	
 
    salesCode = sa.Column(sa.Integer(), nullable=False, default=0)
 
    sales_code = sa.Column('salesCode', sa.Integer(), nullable=False, default=0)
 

	
 
    memberOnly = sa.Column(sa.SmallInteger(), nullable=False, default=0)
 
    member_only = sa.Column('memberOnly', sa.SmallInteger(), nullable=False, default=0)
 

	
 
    def __str__(self):
 
        return self.dept_name or ''
 
        return self.name or ''
 

	
 

	
 
@six.python_2_unicode_compatible
 
@@ -256,7 +257,7 @@ class Product(Base):
 

	
 
    department = orm.relationship(
 
        Department,
 
        primaryjoin=Department.dept_no == dept_no,
 
        primaryjoin=Department.number == dept_no,
 
        foreign_keys=[dept_no],
 
        doc="""
 
        Reference to the :class:`Department` to which the product belongs.
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now