def guest_added(conn, member_of_parliament, guest_to_add, date): if guest_to_add is not None: print("\n-- Parlamentarier_in '{}' hat einen neuen Gast '{}' mit Funktion '{}'.".format( name_logic.fullname(member_of_parliament), name_logic.fullname(guest_to_add), guest_to_add["function"])) # check if the new guest is already a person in the database, if not create them person_id = db.get_person_id(conn, guest_to_add["names"]) if not person_id: print("-- Diese_r muss neu in der Datenbank erzeugt werden") print(create_queries.insert_person(guest_to_add, date)) else: guest_to_add["id"] = person_id print(create_queries.insert_zutrittsberechtigung(member_of_parliament["id"], person_id, guest_to_add["function"], date))
def guest_added(conn, member_of_parliament, guest_to_add, date): if guest_to_add is not None: print("\n-- Parlamentarier_in '{}' hat einen neuen Gast '{}' mit Funktion '{}'.".format( name_logic.fullname(member_of_parliament), name_logic.fullname(guest_to_add), guest_to_add["function"])) # check if the new guest is already a person in the database, if not create them person_id = db.get_person_id(conn, guest_to_add["names"]) if not person_id: print("-- Diese_r muss neu in der Datenbank erzeugt werden") print(sql_statement_generator.insert_person(guest_to_add, date)) else: guest_to_add["id"] = person_id print(sql_statement_generator.insert_zutrittsberechtigung(member_of_parliament["id"], person_id, guest_to_add["function"], date))