From ebdedd364347ec37d5687ae3d7df1cd634c41434 Mon Sep 17 00:00:00 2001 From: "Pavel \"LEdoian\" Turinsky" Date: Mon, 21 Nov 2022 00:50:49 +0100 Subject: [PATCH] =?UTF-8?q?Snippet,=20kter=C3=BDm=20jsme=20n=C4=9Bkdy=20ge?= =?UTF-8?q?nerovali=20probl=C3=A9my=20v=20ipythonu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vyroba_problemu/snippet_z_Gimliho.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vyroba_problemu/snippet_z_Gimliho.py diff --git a/vyroba_problemu/snippet_z_Gimliho.py b/vyroba_problemu/snippet_z_Gimliho.py new file mode 100644 index 00000000..cc79d81b --- /dev/null +++ b/vyroba_problemu/snippet_z_Gimliho.py @@ -0,0 +1,20 @@ +with transaction.atomic(): + assert t.id == 2365 + pfx = f"{t.nazev}, " + # Problémy + for k, b in [(4,3)]: + u = m.Uloha.objects.create( + nadproblem=t, + nazev=pfx + f"{'úloha' if b is not None else 'problém'} {k}", + autor=t.autor, + garant=t.garant, + max_body=b, + cislo_zadani=m.Cislo.get(28, 5), + kod=k, + stav=m.Problem.STAV_ZADANY, + ) + u.opravovatele.set(t.opravovatele.all()) + print(u, u.max_body) + input("rly?") + +