Esempio n. 1
0
def update_payment_status(payment_status, payment_id):
    s = Session()
    statustoupdate = {Payment.payment_status: payment_status}
    paymenttoupdate = s.query(Payment).filter(
        Payment.payment_yandex_id == payment_id)
    paymenttoupdate.update(statustoupdate)
    s.commit()
Esempio n. 2
0
def get_payment_by_payment_id(payment_id):
    s = Session()
    return s.query(Payment).filter(Payment.payment_id == payment_id).first()
Esempio n. 3
0
def get_payment_by_customer(customer):
    s = Session()
    return s.query(Payment).filter(Payment.payment_customer == customer).all()
Esempio n. 4
0
def get_payment_status(status):
    s = Session()
    return s.query(Payment).filter(Payment.payment_status == status).first()
Esempio n. 5
0
def add_payment(payment):
    s = Session()
    s.add(payment)
    s.commit()
Esempio n. 6
0
def get_all_payments():
    s = Session()
    return s.query(Payment).all
Esempio n. 7
0
def get_products_by_type(type):
    s = Session()
    return s.query(Product).filter(Product.product_type == type).all()
Esempio n. 8
0
def get_product_by_id(id):
    s = Session()
    return s.query(Product).filter(Product.id == id).first()
Esempio n. 9
0
def get_all_products():
    s = Session()
    return s.query(Product).all()
Esempio n. 10
0
def add_product(product):
    # Session.Rollback
    s = Session()
    s.add(product)
    s.commit()