除了“标题”字段上的标签外,我有3个部分具有相同的字段。 对他们来说,我用的是同一种Django形式。在
在我看来:
def get(self):
context = self.CONTEXT_CLASS(self.MODEL_CLASS)
context.messages = self.get_messages()
context.section1 = InvoiceContentForm()
context.section2 = InvoiceContentForm()
context.section3 = InvoiceContentForm()
self.render_jinja('templates/invoice/add_edit.html', context.as_dict)
我的表格:
^{pr2}$有什么方法可以在分配给context.section1 = InvoiceContentForm()
时更改InvoiceContentForm()
上的标题标签吗?在
你需要重写它的构造函数
相关问题 更多 >
编程相关推荐