Demo entry 6730952

Finalizar

   

Submitted by Pepe on Apr 09, 2018 at 22:02
Language: Python. Code size: 469 Bytes.

for w in Workshop.objects.filter(requested_by__client=13, end__lte=now, beginning__lte=now, status__in=[Workshop.RESERVED, Workshop.REQUESTED]).order_by('beginning'):
    fixed_asset_items = FixedAssetSupply.objects.filter(workshop=w)

    for fixed_asset_item in fixed_asset_items:
        fixed_asset = fixed_asset_item.fixed_asset
        fixed_asset.times_used += w.student_quantity
        fixed_asset.save()

    w.status = Workshop.FINISHED
    w.save()

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).