Rename vendor model attributes, to be more pythonic
This commit is contained in:
parent
332beb390d
commit
78317b9272
|
@ -105,13 +105,13 @@ class Vendor(Base):
|
||||||
"""
|
"""
|
||||||
__tablename__ = 'vendors'
|
__tablename__ = 'vendors'
|
||||||
|
|
||||||
vendorID = sa.Column(sa.Integer(), primary_key=True, autoincrement=False, nullable=False)
|
id = sa.Column('vendorID', sa.Integer(), primary_key=True, autoincrement=False, nullable=False)
|
||||||
|
|
||||||
vendorName = sa.Column(sa.String(length=50), nullable=True)
|
name = sa.Column('vendorName', sa.String(length=50), nullable=True)
|
||||||
|
|
||||||
vendorAbbreviation = sa.Column(sa.String(length=10), nullable=True)
|
abbreviation = sa.Column('vendorAbbreviation', sa.String(length=10), nullable=True)
|
||||||
|
|
||||||
discountRate = sa.Column(sa.Float(), nullable=True)
|
discount_rate = sa.Column('discountRate', sa.Float(), nullable=True)
|
||||||
|
|
||||||
contact = orm.relationship(
|
contact = orm.relationship(
|
||||||
'VendorContact',
|
'VendorContact',
|
||||||
|
@ -140,7 +140,7 @@ class Vendor(Base):
|
||||||
creator=lambda n: VendorContact(notes=n))
|
creator=lambda n: VendorContact(notes=n))
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.vendorName or ''
|
return self.name or ''
|
||||||
|
|
||||||
|
|
||||||
class VendorContact(Base):
|
class VendorContact(Base):
|
||||||
|
@ -149,7 +149,7 @@ class VendorContact(Base):
|
||||||
"""
|
"""
|
||||||
__tablename__ = 'vendorContact'
|
__tablename__ = 'vendorContact'
|
||||||
|
|
||||||
vendorID = sa.Column(sa.Integer(), sa.ForeignKey('vendors.vendorID'), primary_key=True, autoincrement=False, nullable=False)
|
vendor_id = sa.Column('vendorID', sa.Integer(), sa.ForeignKey('vendors.vendorID'), primary_key=True, autoincrement=False, nullable=False)
|
||||||
|
|
||||||
phone = sa.Column(sa.String(length=15), nullable=True)
|
phone = sa.Column(sa.String(length=15), nullable=True)
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ class Product(Base):
|
||||||
|
|
||||||
vendor = orm.relationship(
|
vendor = orm.relationship(
|
||||||
Vendor,
|
Vendor,
|
||||||
primaryjoin=Vendor.vendorID == default_vendor_id,
|
primaryjoin=Vendor.id == default_vendor_id,
|
||||||
foreign_keys=[default_vendor_id],
|
foreign_keys=[default_vendor_id],
|
||||||
doc="""
|
doc="""
|
||||||
Reference to the default :class:`Vendor` from which the product is obtained.
|
Reference to the default :class:`Vendor` from which the product is obtained.
|
||||||
|
|
Loading…
Reference in a new issue