Commits

Carles Barrobés  committed fe18b7f

Better iteration of a dictionary, unpacking iteritems' returned tuples

  • Participants
  • Parent commits 918b1db

Comments (0)

Files changed (1)

File djangorestframework/views.py

         form = self.get_bound_form()
         if form is not None:
             field_name_types = {}
-            for item in form.fields.iteritems():
-                field_name_types[item[0]] = item[1].__class__.__name__
+            for name, field in form.fields.iteritems():
+                field_name_types[name] = field.__class__.__name__
             response_obj['field_types'] = field_name_types
         return response_obj