excuse my english
I'd like to pass a parameter to the constructor of a form from a FormView. But, because when I use class based views, I'm not the one that create the form object so I am unable to do it this way .
I know maybe the best thing to would be to use a function view instead of a class based view, but does anyone know a way to do it using class based views ?
你不说你使用的是什么类型的基于类视图,但任何继承FormMixin有方法get_form_kwargs
正是这个目的。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.