@@ -356,6 +356,8 @@ def __repr__(self):
356
356
def delete (self , condition = None ):
357
357
"""
358
358
Deletes this object from dynamodb
359
+
360
+ :raises pynamodb.exceptions.DeleteError: If the record can not be deleted
359
361
"""
360
362
args , kwargs = self ._get_save_args (attributes = False , null_check = False )
361
363
version_condition = self ._handle_version_attribute (kwargs )
@@ -371,6 +373,8 @@ def update(self, actions, condition=None):
371
373
372
374
:param actions: a list of Action updates to apply
373
375
:param condition: an optional Condition on which to update
376
+ :raises ModelInstance.DoesNotExist: if the object to be updated does not exist
377
+ :raises pynamodb.exceptions.UpdateError: if the `condition` is not met
374
378
"""
375
379
if not isinstance (actions , list ) or len (actions ) == 0 :
376
380
raise TypeError ("the value of `actions` is expected to be a non-empty list" )
@@ -411,6 +415,7 @@ def refresh(self, consistent_read=False):
411
415
Retrieves this object's data from dynamodb and syncs this local object
412
416
413
417
:param consistent_read: If True, then a consistent read is performed.
418
+ :raises ModelInstance.DoesNotExist: if the object to be updated does not exist
414
419
"""
415
420
args , kwargs = self ._get_save_args (attributes = False )
416
421
kwargs .setdefault ('consistent_read' , consistent_read )
@@ -473,6 +478,7 @@ def get(cls,
473
478
:param range_key: The range key of the desired item, only used when appropriate.
474
479
:param consistent_read
475
480
:param attributes_to_get
481
+ :raises ModelInstance.DoesNotExist: if the object to be updated does not exist
476
482
"""
477
483
hash_key , range_key = cls ._serialize_keys (hash_key , range_key )
478
484
0 commit comments