mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
[py3] Replace filter/lambda by list comprehensions
This is more idiomatic and avoids returning a list on Python 2 and an iterator on Python 3.
This commit is contained in:
@@ -387,7 +387,7 @@ class Options(object):
|
||||
predicates.append(lambda k, v: not k.field.rel.is_hidden())
|
||||
cache = (self._related_objects_proxy_cache if include_proxy_eq
|
||||
else self._related_objects_cache)
|
||||
return filter(lambda t: all([p(*t) for p in predicates]), cache.items())
|
||||
return [t for t in cache.items() if all(p(*t) for p in predicates)]
|
||||
|
||||
def _fill_related_objects_cache(self):
|
||||
cache = SortedDict()
|
||||
|
||||
Reference in New Issue
Block a user