Skip to content

Commit

Permalink
Only add custom attribute names to the mapping. (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinner-lyft committed Sep 3, 2020
1 parent cc6bafa commit ef704dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pynamodb/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ def _initialize_attributes(cls):
initialized = attribute._make_attribute()

cls._attributes[name] = attribute
if attribute.attr_name is not None:
cls._dynamo_to_python_attrs[attribute.attr_name] = name
else:
if attribute.attr_name is None:
attribute.attr_name = name
if attribute.attr_name != name:
cls._dynamo_to_python_attrs[attribute.attr_name] = name

if initialized and isinstance(attribute, MapAttribute):
# To support creating expressions from nested attributes, MapAttribute instances
Expand Down

0 comments on commit ef704dc

Please sign in to comment.