def create(request): d = Department() d.name = request.POST['name'] d.capacity = float(request.POST['capacity'])*19.6*12*8 d.save() dept_id = d.id return HttpResponseRedirect(reverse('teams:show', args = (dept_id,)))
def create_department(name, capacity): dept = Department() dept.name = name #capacity = headcount*19.6(working days per month)*12 months dept.capacity = capacity dept.save()