This should probably be asked on django-users, as it's more about how to use form_for_instance() than any internal development. And yes, that means I don't believe it's a bug, and I'll gladly explain more on django-users so more people can hear it.
-Gul On 11/7/07, David Larlet <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'd spent a long time finding that bug but I want to be sure before > submitting it on Trac. If you pass a form argument to form_for_instance > like that: > > forms.form_for_instance(foo, form=FooForm) > > with an instance of foo which only contains a basic field (let's say a > CharField) and FooForm with a unique field too, the input rendered will > not be completed with the content of the foo instance. If you remove the > form argument: > > forms.form_for_instance(foo) > > the generated form contains the content of the foo instance. > > I'd tried to find the bug but this line (122 of newforms.models): > > return type(opts.object_name + 'InstanceForm', (form,), > {'base_fields': base_fields, '_model': model, > 'save': make_instance_save(instance, fields, 'changed')}) > > give me headaches ;-). The only thing I can say is that base_fields > contains the initial data before this line but my returned form not. > > Did somebody use this argument and can confirm? > > Regards, > David > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---