denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

entity.children(file_role) returns descendants along with direct children #149

Closed gjost closed 5 years ago

gjost commented 5 years ago
(ddrlocal) ddr@deb9a:/opt/ddr-local-develop$ bash runshell.sh
>>> from webui.identifier import Identifier
>>> from webui.models import Stub, Collection, Entity
>>> rid = 'ddr-testing-40204-2-mezzanine'
>>> file_role = Stub.from_identifier(Identifier(rid))
>>> role = file_role.identifier.parts['role']
>>> entity = file_role.parent(stubs=True)
>>> for f in entity.children(role=role):
...     f
... 
<DDR.models.files.File file:ddr-testing-40204-2-mezzanine-bfd32fc418>
<DDR.models.files.File file:ddr-testing-40204-2-mezzanine-fb8c123e41>
<DDR.models.files.File file:ddr-testing-40204-2-2-mezzanine-868d1f3be5>  <<< WRONG
gjost commented 5 years ago

Fixed in commit 3a9c866.