Created
May 4, 2013 13:23
-
-
Save kevinslin/5517505 to your computer and use it in GitHub Desktop.
#django #form #cookbook Reorder fields on django form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __init__(self, *args, **kw): | |
super(EditProfileForm, self).__init__(*args, **kw) | |
index = self.fields.keyOrder.index('about') | |
self.fields.keyOrder.remove('majors') | |
self.fields.keyOrder.insert(index, 'majors') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment