Skip to content

Commit b646d83

Browse files
authored
Support projections in model get function. Fixes pynamodb#337 (pynamodb#403)
1 parent 3378da2 commit b646d83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pynamodb/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ def refresh(self, consistent_read=False):
470470
def get(cls,
471471
hash_key,
472472
range_key=None,
473-
consistent_read=False):
473+
consistent_read=False,
474+
attributes_to_get=None):
474475
"""
475476
Returns a single object using the provided keys
476477
@@ -481,7 +482,8 @@ def get(cls,
481482
data = cls._get_connection().get_item(
482483
hash_key,
483484
range_key=range_key,
484-
consistent_read=consistent_read
485+
consistent_read=consistent_read,
486+
attributes_to_get=attributes_to_get
485487
)
486488
if data:
487489
item_data = data.get(ITEM)

0 commit comments

Comments
 (0)