v2.0.2: fix SQLite — UUID in all INSERTs, now()→datetime, ::jsonb cleanup
Deploy contracts-flask / validate (push) Successful in 0s
Deploy contracts-flask / validate (push) Successful in 0s
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
"""Contracts CRUD."""
|
||||
from db.connection import query, execute, execute_returning
|
||||
import uuid
|
||||
from db.connection import query, execute
|
||||
|
||||
|
||||
def insert(number, client=""):
|
||||
return execute_returning(
|
||||
"INSERT INTO contracts (number, client) VALUES (%s, %s) RETURNING *",
|
||||
(number, client),
|
||||
cid = str(uuid.uuid4())
|
||||
execute(
|
||||
"INSERT INTO contracts (id, number, client) VALUES (%s, %s, %s)",
|
||||
(cid, number, client),
|
||||
)
|
||||
return get(cid)
|
||||
|
||||
|
||||
def get(contract_id):
|
||||
|
||||
Reference in New Issue
Block a user