mirror of
https://github.com/ada-dmitry/lab6.git
synced 2026-09-24 01:10:15 +00:00
fix(unique)_func_insert
This commit is contained in:
Binary file not shown.
@@ -64,8 +64,11 @@ class DbTable:
|
||||
sql += ", ".join(self.column_names_without_id()) + ") VALUES("
|
||||
sql += ", ".join(vals) + ")"
|
||||
cur = self.dbconn.conn.cursor()
|
||||
try:
|
||||
cur.execute(sql)
|
||||
self.dbconn.conn.commit()
|
||||
except psycopg2.errors.UniqueViolation:
|
||||
self.dbconn.conn.rollback()
|
||||
return
|
||||
|
||||
def first(self):
|
||||
|
||||
@@ -117,7 +117,7 @@ class Main:
|
||||
else:
|
||||
return next_step
|
||||
|
||||
def show_add_cath(self):
|
||||
def add_cath(self):
|
||||
data = []
|
||||
data.append(input("Введите название (1 - отмена): ").strip())
|
||||
if data[0] == "1":
|
||||
@@ -178,7 +178,7 @@ class Main:
|
||||
elif current_menu == "2":
|
||||
self.show_main_menu()
|
||||
elif current_menu == "3":
|
||||
self.show_add_cath()
|
||||
self.add_cath()
|
||||
current_menu = "1"
|
||||
print("До свидания!")
|
||||
return
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user