Thanks for the reply. formset.is_valid returns False but formset.errors returns an empty list.The same applies for the SpeciesFormSet.What would this suggest? Cheers.
On May 19, 7:04 pm, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Wednesday, May 18, 2011 11:46:14 PM UTC+1, piker wrote: > > > I have a modelformset_factory instance displaying beautifully, but not > > saving to the database. > > If anyone can spot any mistake i've made in the code it would be much > > appreciated.(i'm using Django 1.3 by the way). > > > def warning_entry (request): > > SpeciesFormSet = > > modelformset_factory(Species,fields=('botanical_name', > > 'supply_warning')) > > if request.method == 'POST': > > formset = SpeciesFormSet(request.POST,request.FILES) > > if formset.is_valid(): > > formset.save() > > return HttpResponseRedirect('/plants/') > > else: > > formset = SpeciesFormSet() > > return render_to_response ('plant > > warnings.html',locals(),context_instance=RequestContext(request)) > > Are you sure that the formset is valid? What's the output of formset.errors? > -- > DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.