1
请帮助更改屏幕上表单域的顺序。如何改变字段的顺序?
我创建了以下模型:
class MyRegistrationForm(UserCreationForm):
username = forms.CharField(
label='username',
help_text='',
required=True,
)
password1 = forms.CharField(
label='pass1',
help_text='',
required=True,
)
password2 = forms.CharField(
label='pass2',
help_text='',
required=True,
)
class Meta:
model = UserProfile
fields = ('status', 'address')
作为用户看到显示在显示字段在这样的结果:这个模型与登记表的字段内置的
class UserProfile(User):
status = models.CharField(
max_length=30,
blank=True,
)
address = models.EmailField(
max_length=50,
blank=True,
)
objects = UserManager()
然后组合场订单: 状态,地址,用户名,pass1,pass2
但我需要用户按以下顺序查看屏幕字段: 用户名,地址,PASS1,PASS2,状态