Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions