Oh shoot, I think I know now why this isn't working for me.
It is because I'm using vanilla for my views. I'll continue to test.
On Friday, December 14, 2018 at 8:34:15 PM UTC+8, Simon A wrote:
>
> Just to add, I used a django-crud cookie cutter to generate codes for CRUD
>
> On Monday, December 10, 2018 at 8:47:28 PM UTC+8, Simon A wrote:
>>
>> I'm trying to pass a parameter from a redirect to the CreateView and to
>> the form.
>>
>> I have no problem retrieving the value from the redirect to the
>> CreateView.
>>
>> But my issue is when trying get the value to the form. I'm overriding
>> get_form_kwargs function of my CreateView but when I try to do operations
>> from that function, I'm not able to get any result. I tried to do a print
>> but the print won't display anything.
>>
>>
>> *class NoteCreate(LoginRequiredMixin, CreateView):
>> login_url = 'login'
>> model = Note
>> form_class = NoteForm
>> success_url = reverse_lazy('note:list')
>>
>> def get_form_kwargs(self):
>> kwargs = super(NoteCreate, self).get_form_kwargs()
>> kwargs.update({'file_id' : self.kwargs['file_id']})
>> print("im alivveeeeeeeEeeeeeeeeeeeee!")
>> return** kwargs*
>>
>> the print statement doesn't seem to be working. It does not show anything
>> in the console.
>>
>> I'm able to render the form with no errors in the console.
>>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/701234c8-f755-469d-80dc-20d0440c3bee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.