[idea] support __len__ on AppenderQuery to unify usage with non lazy=dynamic loaded collections
Issue #4013
closed
Hi there,
during a refactoring from lazy=False to lazy=dynamic on some of our relationships, it would have made our life quite a bit easier if the attribute wouldn't have just supported iteration and ranged queries, but also len (to emit a count() query).
Is that something you would consider? It shouldn't be too hard to implement.
Our use case is, that we have some template mixins, that are quite generic and would like to consume both lazy=dynamic as well as regular relations.
Comments (3)
-
repo owner -
reporter Unfortunate, but understandable. Thanks!
-
repo owner - changed status to closed
alrighty!
- Log in to comment
hello -
unfortunately this is not a new idea, it is quite old and unfortunately not feasible. please see: http://docs.sqlalchemy.org/en/latest/faq/sessions.html#query-has-no-len-why-not