reformat code with black
This commit is contained in:
@@ -5,21 +5,21 @@ from flask_sqlalchemy import BaseQuery
|
||||
|
||||
|
||||
class ContractCustomerQuery(BaseQuery):
|
||||
|
||||
def reseller_store(self, url, territory):
|
||||
return self.filter(
|
||||
ContractCustomer.dealerstore == True,
|
||||
ContractCustomer.dealerurl == url,
|
||||
ContractCustomer.country == territory).first()
|
||||
ContractCustomer.country == territory,
|
||||
).first()
|
||||
|
||||
|
||||
class ContractCustomer(db.Model):
|
||||
|
||||
__tablename__ = 'contract_customers'
|
||||
__tablename__ = "contract_customers"
|
||||
|
||||
query_class = ContractCustomerQuery
|
||||
|
||||
id = db.Column('contractcustomerid', db.Integer, primary_key=True)
|
||||
id = db.Column("contractcustomerid", db.Integer, primary_key=True)
|
||||
country = db.Column(db.String(2))
|
||||
pricepremium = db.Column(db.Numeric, nullable=False, default=0)
|
||||
dealerstore = db.Column(db.Boolean, nullable=False, default=False)
|
||||
@@ -27,8 +27,8 @@ class ContractCustomer(db.Model):
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'pricepremium': self.pricepremium,
|
||||
'dealerstore': self.dealerstore,
|
||||
'dealerurl': self.dealerurl
|
||||
"id": self.id,
|
||||
"pricepremium": self.pricepremium,
|
||||
"dealerstore": self.dealerstore,
|
||||
"dealerurl": self.dealerurl,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user