-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Discussion
We've been having the need to filter for an asset the available "looks" (specifically the latest versions) and list them to the artist. Currently there's no way, by subset, to know whether it contains a specific family so it requires.
To me personally, a subset is a specific family, and during its lifetime of existence it shouldn't change to house any versions of a different family. For example subset lookDefault would never get a version of family model if the first version was a look family, I would disallow it changing the family over its lifetime.
Problem
Currently listing all latest look families requires something along the lines of:
subsets = io.find({"type": "subset", "parent": asset_id})
looks = list()
for subset in subsets:
versions = io.find({"type": "version", "parent": subset['_id']})
has_look = any(x for x in versions if x['data']['family'] == "look")
if not has_look:
continue
looks.append(subset)
print looksStill, this would also allow that the subsets returned might possibly contain different families than a look. So one of the versions in the subset could in practice be a camera family or model family.
By locking the subset to a specific family the subset presents itself more clearly to the artist, directly, plus it persists over time. Additionally this simplifies listing the looks for an asset to:
looks = io.find({"family": "look", "type": "subset", "parent": asset_id})What do you think?