0

I want to send model form object in the URLConf just like this

 url('^myUrl/Url/$',
'myView',
 {"EvaluationForm": MyModelForm()},

when i try to get this form in the view like this.

myView(request, EvaluationForm=None):
form = EvaluationForm(request.POST)

i get the following error.

'MarketExpertEvaluationForm' object is not callable

Can anybody tell me whats the problem here?

Thanks.

4

1 回答 1

2

不要创建和传递实例,而是尝试将 url 中的类对象传递为

url('^myUrl/Url/$',
   'myView',
    {"EvaluationForm": MyModelForm}, #<-- note no ()
于 2013-07-26T07:03:39.637 回答