Changes between Initial Version and Version 1 of Ticket #27240
- Timestamp:
- Sep 18, 2016, 11:58:52 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27240 – Description
initial v1 9 9 }}} 10 10 11 I need to fill this parameter with `request.user` value. In frontend I use the method recommended in [https://docs.djangoproject.com/en/1.9/topics/forms/formsets/#passing-custom-parameters-to-formset-forms docs] 11 I need to fill this parameter with `request.user` value. In frontend I use the method recommended in [https://docs.djangoproject.com/en/1.9/topics/forms/formsets/#passing-custom-parameters-to-formset-forms docs] (code omitted for brevity). 12 12 13 13 {{{#!python … … 15 15 AttachmentFormSet = generic_inlineformset_factory(Attachment, form=AttachmentForm, max_num=3, validate_max=True) 16 16 if request.method == 'POST': 17 form = EnterpriseForm(request.POST, request.FILES, instance=enterprise, user=request.user)18 17 attachment_formset = AttachmentFormSet(request.POST, request.FILES, instance=enterprise, form_kwargs = {'user': request.user}) 19 # ...20 18 else: 21 form = EnterpriseForm(instance=enterprise, user=request.user)22 19 attachment_formset = AttachmentFormSet(instance=enterprise, form_kwargs = {'user': request.user}) 23 20 # ...