Я хочу, чтобы значение из формы допуска сохранялось в полях допуска и in_stock. на странице заполнения формы нет формы in_stock
models.py
class Admission(models.Model):
name = models.CharField(max_length=100,db_index=True)
date = models.DateTimeField()
in_stock = models.IntegerField(blank=True)
admission = models.IntegerField()
def __str__(self):
return '{}'.format(self.name)
forms.py
class AdmissionForm(forms.ModelForm):
class Meta:
model = Admission
fields = ['date', 'name', 'admission', 'in_stock']
views.py
class AdmissionCreate(View):
def get (self, request):
form = AdmissionForm()
return render(request, 'inventory/addAdmissions.html', context={'form': form})
def post(self, request):
form = AdmissionForm(request.POST)
if form.is_valid():
form.save()
return redirect(admission_list)