Then use a ModelForm for your model, and pass in each dict as the 'data' field.
This lets you re-use all the hard work already done in the ModelForm,
because the is_valid() method will validate your input, and the save()
method will create a new instance.
You pass the dictionary in as the data kwarg -- the same place you'd
usually pass request.POST.
> file is for creating multiple models - one model per CSV line - how will
> that work with a single ModelForm? Do I just call it repeatedly?
Sure, in a loop
> And how will I then capture the ValidationError and get them back in my
> form?
If form.is_valid() is False, you can return form.errors.as_text() to your user.
> Cheers,
> Victor
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/wT8cDUDW62IJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
--
Shawn Milochik
CTO
Greenphire