this URI stuff is a mess
This commit is contained in:
parent
5526cc8b16
commit
1f43030252
@ -176,6 +176,9 @@ class APIObject(object):
|
||||
|
||||
@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:
|
||||
@ -185,6 +188,9 @@ class APIObject(object):
|
||||
return path
|
||||
|
||||
def url(self, parent=None):
|
||||
if self._data:
|
||||
if 'uri' in self._data:
|
||||
return self._data['uri']
|
||||
return self.__class__.makeUrl(self.id, parent)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user