Files
KPK/Milan_cenik2.py
T
2026-06-23 15:20:56 +02:00

34 lines
899 B
Python

#replace ceniku na jeden request
import tst_data
import api_call
from pydantic import SecretStr
# ---------- vytvoření testovacího ceníku ----------
cenik = tst_data.create_tst_cenik("01")
for p in cenik.cenpol:
for pos in p.pos_pc:
print(p.d_name, pos.page, pos.line, pos.col)
# ---------- API context ----------
def get_ctx():
ctx = api_call.ApiContext(
user="Alto",
base_url="http://127.0.0.1:8000",
refresh_url="http://127.0.0.1:8000",
client_id="99",
id_kas="01",
username="Kobrle",
password=SecretStr("heslo"),
)
return ctx
ctx = get_ctx()
# ---------- login ----------
api_call.login_API(ctx)
# ---------- načtení setup ----------
setup = api_call.load_setup_API(ctx)
# ---------- uložení CELÉHO ceníku ----------
api_call.debugrepl2_cenik_API(
ctx,
cenik.cenpol # ← list[CenPolCreate]
)