Answer the question
In order to leave comments, you need to log in
Django user entered a number, was that number added to the saved one and saved?
FORMS.PY:
class FishSpeedFarm(forms.ModelForm):
class Meta:
model = FishSpeed
fields = ('maliyk',)
def fishspeed_farm(request):
fishspeed_farm = FishSpeedFarm(instance=request.user.fishspeed)
if request.method == "POST":
fishspeed_farm = FishSpeedFarm(request.POST,request.FILES,instance=request.user.fishspeed)
if fishspeed_farm.is_valid():
fishspeed_farm.save()
return render(request, 'fishspeed/farm.html',{
'fishspeed_farm':fishspeed_farm,
})
class FishSpeed(models.Model):
maliyk = models.IntegerField(default="0", verbose_name='Whitebait')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question