Add a helper method to Image to parse ancestor string.
This commit is contained in:
parent
cd8b45e25b
commit
1d8b72235a
6 changed files with 33 additions and 32 deletions
|
@ -616,6 +616,12 @@ class Image(BaseModel):
|
|||
(('security_indexed_engine', 'security_indexed'), False),
|
||||
)
|
||||
|
||||
def ancestor_id_list(self):
|
||||
""" Returns an integer list of ancestor ids, ordered chronologically from
|
||||
root to direct parent.
|
||||
"""
|
||||
return map(int, self.ancestors.split('/')[1:-1])
|
||||
|
||||
|
||||
_ImageProxy.initialize(Image)
|
||||
|
||||
|
|
Reference in a new issue