Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 6324cf5

Browse files
committed
Atomx.delete can take a atomx.models instance as argument
1 parent 32167d4 commit 6324cf5

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add ``dsp`` reporting scope.
66
- Add ``daterange`` parameter to :meth:`atomx.Atomx.report`.
77
- :meth:`atomx.models.AtomxModel.reload` takes kwargs parameter
8+
- :meth:`atomx.Atomx.delete` can take a `atomx.models` instance as argument
89

910

1011
1.6

atomx/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ def delete(self, resource, *args, **kwargs):
418418
delete request.
419419
:return: message or resource returned by the api.
420420
"""
421+
if hasattr(resource, '_resource_name') and hasattr(resource, 'id'):
422+
resource = '{}/{}'.format(resource._resource_name, resource.id)
421423
resource = resource.strip('/')
422424
for a in args:
423425
resource += '/' + str(a)

0 commit comments

Comments
 (0)