Hello again.
I tried this:
AsignacionItemFormset = formset_factory(AsignacionItemForm,
can_delete=True, extra=0)
initial_data = []
for item in initialdataquery:
initial_data.append({...})
# Now I append an extra item with the defaul initial data
initial_data.append({'asignacion_id':1})
formse
Hi, I have been debugin. I understand that assigning initial values
directly to each form in the formset is not the way. One question
other though. How would you go if you had to change the queryset of a
ModelChoiceField inside the view code?
Now, I'm doing form.fields['gondola'].queryset = gondo
hi
form is being cleaned only if it's values are different from initial
values, so debug.
btw,
you can't do form.field['..'].initial = '..'
initial must be dictionary, not list
V.
On Oct 14, 12:34 am, Federico H <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm using a formset with hidden fields in the f
Hi,
I'm using a formset with hidden fields in the forms and other required
fields. Those fields need to be initialized with some value. When I
try to validate the formset I get "required field" errors for those
other required fields. The formset apparently thinks that the
extraform is half filled
4 matches
Mail list logo