v1.0.155: VM PostgreSQL + modular db/ & services/ — Lucee stays SPA shell only
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""spec_current — текущее состояние спецификации."""
|
||||
from .connection import query
|
||||
|
||||
|
||||
def list_by_contract(contract_id):
|
||||
"""Return list of dicts with name_hash, name, price, qty, sum, date_start."""
|
||||
return query(
|
||||
"""SELECT name_hash, name, price, qty, sum, date_start
|
||||
FROM spec_current WHERE contract_id = %s ORDER BY name""",
|
||||
(contract_id,),
|
||||
)
|
||||
|
||||
|
||||
def get_elements_json(document_id):
|
||||
"""Get elements_json for a document."""
|
||||
rows = query(
|
||||
"SELECT elements_json FROM documents WHERE id = %s", (document_id,)
|
||||
)
|
||||
return rows[0]["elements_json"] if rows and rows[0]["elements_json"] else None
|
||||
Reference in New Issue
Block a user