Skip to content

Commit 5c4e9f0

Browse files
author
jm
committed
add resourcePolicy from d
1 parent e46b57a commit 5c4e9f0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

dspace_rest_client/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def __init__(self, api_resource=None):
2828
Default constructor
2929
@param api_resource: optional API resource (JSON) from a GET response or successful POST can populate instance
3030
"""
31+
self._from_d = None
3132
if api_resource is not None:
33+
self._from_d = api_resource
3234
if 'type' in api_resource:
3335
self.type = api_resource['type']
3436
if '_links' in api_resource:
@@ -135,6 +137,10 @@ def __init__(self, api_resource=None, dso=None):
135137
if '_links' in api_resource:
136138
self.links = api_resource['_links'].copy()
137139

140+
@property
141+
def resourcePolicies(self):
142+
return (self._from_d or {}).get('resourcePolicies')
143+
138144
def add_metadata(self, field, value, language=None, authority=None, confidence=-1, place=None):
139145
"""
140146
Add metadata to a DSO. This is performed on the local object only, it is not an API operation (see patch)

0 commit comments

Comments
 (0)