#19790: myform.is_valid() is always giving me false!
-------------------------------+------------------------
Reporter: anonymous | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.4
Severity: Normal | Keywords: is_valis()
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------
here's what I have in models.py 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 views.py I have
def add(request):
if 'name' in request.POST:
form = RecipeForm(request.POST)
if form.is_valid():
r.save(force_insert=True)
return HttpResponse("it's working")
else:
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 ?
Thanks
--
Ticket URL: <https://code.djangoproject.com/ticket/19790>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.