def amc(self): self.monthlycost = MealInput.abirmeal(self) * self.depomealrate() return round(float(self.monthlycost), 3)
def mmc(self): self.monthlycost = MealInput.mehedimeal(self) * self.depomealrate() return round(float(self.monthlycost), 3)
def smc(self): self.monthlycost = MealInput.shafinmeal(self) * self.depomealrate() return round(float(self.monthlycost), 3)
def mealinputformview(request): if request.method == 'POST': if request.POST.get('date') \ and request.POST.get('ml') and request.POST.get('md')\ and request.POST.get('ol') and request.POST.get('od')\ and request.POST.get('sl') and request.POST.get('sd') \ and request.POST.get('bl') and request.POST.get('bd') \ and request.POST.get('nl') and request.POST.get('nd') \ and request.POST.get('al') and request.POST.get('ad'): meal = MealInput() meal.date = request.POST.get('date') meal.mehedil = request.POST.get('ml') meal.mehedid = request.POST.get('md') meal.omarl = request.POST.get('ol') meal.omard = request.POST.get('od') meal.shafinl = request.POST.get('sl') meal.shafind = request.POST.get('sd') meal.bikil = request.POST.get('bl') meal.bikid = request.POST.get('bd') meal.nurul = request.POST.get('nl') meal.nurud = request.POST.get('nd') meal.abirl = request.POST.get('al') meal.abird = request.POST.get('ad') meal.save() return redirect('mealinput') else: return render(request, 'mealinput.html')