Hi Shawn,

many thanks for your reply.

Am 07.10.2015 um 15:54 schrieb Shawn Milochik:
You /can/ use ModelForms for this. You don't need an active instance.

Thanks, I'll definitively check this out!

However, using a ModelForm wastes performance when the POST request is processed, doesn't it?

This is because both in the GET and the POST request, I have to construct the queryset in order to have the instances that the formset is about:

  - in the GET request, the queryset is needed in order to construct the 
formset,
- in the POST request, the queryset is needed for comparison, in order to detect unexpected changes (e.g. a calender entry that didn't exist at the time of the GET request suddenly exists at the time of the POST request, or vice versa, etc.)

If I used ModelForms in such a formset, all objects were instantiated both in the original queryset as well as in all the ModelForms constructed from request.POST, essentially duplicating the database queries, wouldn't they?

You can have multiple forms using "prefix," which could just be the date as a 
string.

Why would I need "prefix" if a formset is used already?

Best regards,
Carsten

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/561672EB.3070807%40cafu.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to