Closed Ogreman closed 8 years ago
I'm glad to see someone working on this.
Your implementation seems pretty slick, but I'm not sure how it behaves with nested lookups on iterables. For example, what happens when you run lifter.load(companies); manager.filter(users__tags__name='nice'
, assuming both users
and tags
are iterables ?
(Cannot test this right now, this is why I ask, but I'll try it by myself as soon at possible)
EDIT: I've updated the issue with a more complete example.
Something like that?
That's really impressive. I think the last minor issue remains with the test itself:
self.assertNotIn(users[1], manager.filter(employees__tags__name='friendly'))
# should be
self.assertNotIn(companies[1], manager.filter(employees__tags__name='friendly'))
Apart from that, I'm ready to merge.
Added tests from example within issue #3.
Follows the EAFP pattern used in
resolve_attr
, and creates an object which is used to check whether a value is present in a given iterable.