Skip to content

Commit

Permalink
Support assignment in ClassLookupDict
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Jan 23, 2015
1 parent 5bb3486 commit 889a07f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rest_framework/utils/field_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def __getitem__(self, key):
return self.mapping[cls]
raise KeyError('Class %s not found in lookup.', cls.__name__)

def __setitem__(self, key, value):
self.mapping[key] = value


def needs_label(model_field, field_name):
"""
Expand Down

0 comments on commit 889a07f

Please sign in to comment.