this URI stuff is a mess

master
Marek Isalski 2 years ago
parent 1f43030252
commit 59acc9071f

@ -170,15 +170,12 @@ class APIObject(object):
raise ValueError("%s not yet created" % (self.__class__.__name__,))
if not self._data:
raise ValueError("No data associated with record.")
self._data = self._api.put(self.makeUrl(), data=self._data)
self._data = self._api.put(self.url(), data=self._data)
self.id = int(self._data.get("id"))
return self._data
@classmethod
def makeUrl(cls, id=None, parent=None):
if self._data:
if 'uri' in self._data:
return self._data['uri']
if id:
path = "/%s/%d/" % (cls.URLPART, id)
else:

Loading…
Cancel
Save