thanks. and how do I pass these arguments within the view? UploadFormSet = formset_factory(form=UploadForm, formset=BaseUploadFormSet, extra=5, PATH_SERVER, path) ... or ... ???
On Aug 20, 5:52 pm, "Justin Fagnani" <[EMAIL PROTECTED]> wrote: > On Wed, Aug 20, 2008 at 8:34 AM, patrickk <[EMAIL PROTECTED]> wrote: > > > ok. I know how to use BaseFormSet, but how do I override > > _construct_form resp. how do I pass the parameters. btw, it seems > > quite odd to override _construct_form when usually one has to override > > __init__. > > __init_() simply calls _construct_forms() as it's last statement. This > makes it easy to customize form creation. > > I think it'd be a bit easier for you to turn 'path_server' and 'path' > into keyword arguments. That way your implementation of > _construct_form() can use super() and be very simple: > > def _construct_form(self, i, **kwargs): > return super(BaseFormSet, self)._construct_form(i, > **{'path_server':foo, 'path':bar}) > > Otherwise you'll have to copy and paste BaseFormSet._construct_form into > yours. > > -Justin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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-users?hl=en -~----------~----~----~----~------~----~------~--~---