Thanks Oleg,that worked..its always the last thing that you try, isn't
it?
However.. I have it displaying beautifully now but it won't save.I
can't pick whats wrong with this code that it won't save it.It just
does nothing.Not even an error.If anyone can spot the mistake 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))
On May 18, 9:33 pm, Oleg Lomaka <[email protected]> wrote:
> You need
> ModelFormSet<http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#model-f...>.
> By default, it creates forms for all models from given queryset.
>
>
>
>
>
>
>
> On Wed, May 18, 2011 at 12:20 PM, piker <[email protected]> wrote:
> > Ok, I've managed to create a ModelForm instance that enables me to
> > input totally new items into the database, but i'm at a loss to work
> > out how to display all the existing items in a model, on one page,
> > edit them and submit them in one save(). Is that possible? I'd really
> > appreciate some help here as I am at a dead-stop. Cheers.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.