コード例 #1
0
def changestuff():
    session = Session()
    a1, a2 = session.query(A)
    b1, b2, b3 = session.query(B)
    a1.name = "first a modified"
    b2.a = a2
    session.delete(b3)
    session.commit()
コード例 #2
0
def changestuff():
    session = Session()
    a1, a2 = session.query(A)
    b1, b2, b3 = session.query(B)
    a1.name = "first a modified"
    b2.a = a2
    session.delete(b3)
    session.commit()
コード例 #3
0
def teardown():
    session = Session()
    # map(session.delete, session.query(A))

    for a in session.query(A).all():
        session.delete(a)
    for b in session.query(B).all():
        session.delete(b)
    for op in session.query(models.Operation).all():
        session.delete(op)
    for ver in session.query(models.Version).all():
        session.delete(ver)

    session.commit()
コード例 #4
0
def teardown():
    session = Session()
    for a in session.query(A).all():
        session.delete(a)
    for b in session.query(B).all():
        session.delete(b)
    for op in session.query(models.Operation).all():
        session.delete(op)
    session.commit()
コード例 #5
0
def teardown():
    session = Session()
    As = session.query(A).all()
    Bs = session.query(B).all()
    Ops = session.query(models.Operation).all()

    for a in As:
        session.delete(a)
    # map(session.delete, As)  # for some reason mapping session.delete does not execute
    for b in Bs:
        session.delete(b)
    # map(session.delete, Bs)  # for some reason mapping session.delete does not execute
    for op in Ops:
        session.delete(op)
    # map(session.delete, Ops)  # for some reason mapping session.delete does not execute

    session.commit()