阅读背景:

如何为request.POST构建自定义“list-type”条目

来源:互联网 

Basically I have a model with a ManyToMany field, and then a modelform derived from that model where that field is rendered as a "multiple choice" selectbox. In my template I'm having that field omitted, electing instead to prepare the values for that field in the view, then pass those prepared values into request.POST (actually a copy of request.POST because request.POST is immutable), then feeding request.POST to the form and then carry on as normal. I can't figure out how to do this, because request.POST isn't just a simple python dictionary, but instead a QueryDict, which behaves a little differently. Basically I have a model with a ManyToMany fiel




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: