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