Opened 3 years ago

Closed 3 years ago

#19790 closed Uncategorized (invalid)

myform.is_valid() is always giving me false!

Reported by: anonymous Owned by: nobody
Component: Uncategorized Version: 1.4
Severity: Normal Keywords: is_valis()
Cc: samantoutita@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


here's what I have in class Recipe(models.Model):

name = models.CharField(max_length=200)

prep_steps = models.TextField()
time_to_prepare = models.IntegerField()

class RecipeForm(ModelForm):

class Meta:

model = Recipe

and in I have

def add(request):

if 'name' in request.POST:

form = RecipeForm(request.POST)
if form.is_valid():
return HttpResponse("it's working")


return render_to_response('create_recipe.html', {'error': True})

return HttpResponse("it's NOT working")

for some reason the form.is_valid() is always false.
Can someone see what I can fix in it ?


Change History (2)

comment:1 Changed 3 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by aaugustin

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top