我需要重新排列一个来自其他基类的模型表单中的字段。找不到解决方法。下面代码片段中的“地址”始终出现在HTML模板的开头。如何将其移动到渲染模板中的更下方?谢谢。
class Address:
street= ...
city= ...
class Customer(Address):
name = ...
...
class CustomerForm(ModelForm):
def __init__(...)
super(CustomerForm, self).__init__(*args, **kw)
self.fields.keyOrder=[
'name',
'Address', #<-- I want "Address" appear after the name in my template
#<-- This obviously is not the right code.
class Meta:
model = Customer
-P