Closed agateblue closed 8 years ago
Considering the following structure:
users = [ 'name': 'Kurt', 'tags': [ {'name': 'nice'}, {'name': 'friendly'}, ] ]
It would be nice if nested lookups allowed us to run queries on the iterable objects, instead of the iterable itself, such as:
manager.filter(tags__name='nice') # >>> return all users having at least a tag named 'nice'
EDIT:
Ideally, lookups on iterables would also be nestable:
companies = [ { 'name': 'blackbooks' 'employees': [ { 'name': 'Manny', 'tags': [ {'name': 'nice'}, {'name': 'friendly'}, ] } ] }, { 'name': 'community' 'employees': [ { 'name': 'Britta', 'tags': [ {'name': 'activist'}, ] } ] } ] lifter.load(companies) assert lifter.filter(employees__tags__name='friendly') == companies[0]
Considering the following structure:
It would be nice if nested lookups allowed us to run queries on the iterable objects, instead of the iterable itself, such as:
EDIT:
Ideally, lookups on iterables would also be nestable: