Question: Im working on a django app, where i can create silos and their capacities e . g Wheat - 5 0 t . . The

Im working on a django app, where i can create silos and their capacities e.g Wheat-50t.. The silos contain a unique grain_type say wheat. A given grain type can exist in 1 or more silos (e.g 3 silos of 50t containing wheat). during brewing, i draw grain from the silos for example if i want to use 10t of wheat, i just update brewing logs by selecting the grain type and what has been used.
When i need to draw from a given silo and there isnt enough quantity, draw what is left and pick the rest from another silo with the same grain type.
notify if qty is below 50%.
I used the code below to show % using the bootstrap progress bar in the silo grain card
def index(request):
silos = Silo.objects.all()
for silo in silos:
silo.percentage =(silo.quantity / silo.capacity)*100 if silo.capacity !=0 else 0
return render(request, 'brewing/index.html',{'silos': silos})
I used colors to differentiate the 10t,40t, and 50t capacity silos on the frontend as seen below.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!