this URI stuff is a mess
This commit is contained in:
parent
1f43030252
commit
59acc9071f
@ -170,15 +170,12 @@ class APIObject(object):
|
|||||||
raise ValueError("%s not yet created" % (self.__class__.__name__,))
|
raise ValueError("%s not yet created" % (self.__class__.__name__,))
|
||||||
if not self._data:
|
if not self._data:
|
||||||
raise ValueError("No data associated with record.")
|
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") )
|
self.id = int(self._data.get("id"))
|
||||||
return self._data
|
return self._data
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def makeUrl(cls, id=None, parent=None):
|
def makeUrl(cls, id=None, parent=None):
|
||||||
if self._data:
|
|
||||||
if 'uri' in self._data:
|
|
||||||
return self._data['uri']
|
|
||||||
if id:
|
if id:
|
||||||
path = "/%s/%d/" % (cls.URLPART, id)
|
path = "/%s/%d/" % (cls.URLPART, id)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user