def Get_credit(ID_client): id_credit = [] account = Account.select().where((Account.ID_client == ID_client)) for it in account: if Offer.get(Offer.ID_offer == it.ID_offer).type == ('credit'): id_credit.append(it.ID_account) return id_credit
def Get_debet(ID_client): id_debet = [] debet_account = Account.select().where(Account.ID_client == ID_client, Account.ID_offer == 1) for it in debet_account: id_debet.append(it.ID_account) return id_debet