Dear Django developers,

Lately, I've been working a lot with Django's modelformsets in
combination with javascript. The BaseFormSet implements a handy method
_get_empty_form, accessible through the empty_form property. This
method checks whether formset.is_bound is True, and if it is, updates
the kwargs passed to the formclass with the supplied data and files.

This behaviour strikes me as odd. It results in a form that can no
longer be considered empty, but is bound and, possibly, can contain
errors. Of course, this only happens *after* the formset has been
posted. As a result, a formset.empty_form can no longer be used as a
(javascript) template for creating new forms on the client side, since
it is unpredictable.

Is there a specific reason that it was implemented in this way? In my
opinion, an unbound empty_form would make much more sense.

I hope I have made my concern clear,

Yours truly,
Hidde-Jan

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to