Merge "Refactor the getid method base.py"
This commit is contained in:
@@ -31,10 +31,7 @@ def getid(obj):
|
|||||||
Abstracts the common pattern of allowing both an object or an
|
Abstracts the common pattern of allowing both an object or an
|
||||||
object's ID (UUID) as a parameter when dealing with relationships.
|
object's ID (UUID) as a parameter when dealing with relationships.
|
||||||
"""
|
"""
|
||||||
try:
|
return getattr(obj, 'id', obj)
|
||||||
return obj.id
|
|
||||||
except AttributeError:
|
|
||||||
return obj
|
|
||||||
|
|
||||||
|
|
||||||
class Manager(object):
|
class Manager(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user