Advertisement
Guest User

Untitled

a guest
Aug 27th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. kolvo=dict(request.POST).get("kolvo")
  2. nak_id=request.GET.get("n")
  3. try:
  4.     kolvo=[float(k.replace(",",".")) for k in kolvo]
  5. except ValueError:
  6.     return redirect(f"/accounts/profile/zagot/accept_products?n={nak_id}&e=1")
  7. zagot_products=Zagot_products.objects.filter(......).order_by("product")[:len(kolvo)]
  8. for zp, i in enumarate(zagot_products):
  9.     zp.kolvo=kolvo[i]
  10.     zp.status=True
  11.     zp.save()
  12. Nakl_for_zagot.objects.filter(.....).update(is_taken=True)
  13. return redirect("/accounts/profile/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement