reformat code with black

This commit is contained in:
Martin
2019-10-30 13:44:04 +01:00
parent 354e959cc5
commit 0dd8d619b4
28 changed files with 1236 additions and 689 deletions
+18 -12
View File
@@ -6,9 +6,9 @@ from api.lib.utils import round_half_up
class Inquiry(db.Model):
__tablename__ = 'inquiries'
__tablename__ = "inquiries"
id = db.Column('inquiryid', db.Integer, primary_key=True)
id = db.Column("inquiryid", db.Integer, primary_key=True)
territory = db.Column(db.String(2))
product_group = db.Column(db.String(100))
price_m2 = db.Column(db.Numeric)
@@ -17,24 +17,30 @@ class Inquiry(db.Model):
width = db.Column(db.Integer)
height = db.Column(db.Integer)
framed = db.Column(db.Integer, nullable=False, default=0)
dealer_store_id = db.Column('dealer_store', db.Integer, db.ForeignKey(
'contract_customers.contractcustomerid'))
dealer_store = db.relationship('ContractCustomer', uselist=False)
dealer_store_id = db.Column(
"dealer_store",
db.Integer,
db.ForeignKey("contract_customers.contractcustomerid"),
)
dealer_store = db.relationship("ContractCustomer", uselist=False)
hanger = db.Column(db.String)
materialid = db.Column(db.Integer, db.ForeignKey(
'product-materials.materialid'), default=1, nullable=False)
material = db.relationship('Material', uselist=False)
materialid = db.Column(
db.Integer,
db.ForeignKey("product-materials.materialid"),
default=1,
nullable=False,
)
material = db.relationship("Material", uselist=False)
pricepremium = db.Column(db.Numeric, nullable=False, default=0)
productId = db.Column(db.Integer, db.ForeignKey(
'product-products.productid'))
product = db.relationship('Product', uselist=False)
productId = db.Column(db.Integer, db.ForeignKey("product-products.productid"))
product = db.relationship("Product", uselist=False)
automated = db.Column(db.Integer, nullable=False, default=0)
@property
def market(self):
market = market_model.from_territory(self.territory)
if not market:
raise ValueError('Invalid territory: {}'.format(self.territory))
raise ValueError("Invalid territory: {}".format(self.territory))
return market
def local_price_retouch(self, rounded=True, inc_vat=False):