I think it would be cleaner to do this as ``for field in sorted(self.get_form(self.get_form_class()).fields.keys()))``