MCPcopy
hub / github.com/django/django / count_active_tables

Method count_active_tables

django/db/models/sql/query.py:1126–1132  ·  view source on GitHub ↗

Return the number of tables in this query with a non-zero reference count. After execution, the reference counts are zeroed, so tables added in compiler will not be seen by this method.

(self)

Source from the content-addressed store, hash-verified

1124 return alias
1125
1126 def count_active_tables(self):
1127 """
1128 Return the number of tables in this query with a non-zero reference
1129 count. After execution, the reference counts are zeroed, so tables
1130 added in compiler will not be seen by this method.
1131 """
1132 return len([1 for count in self.alias_refcount.values() if count])
1133
1134 def join(self, join, reuse=None):
1135 """

Callers 2

pre_sql_setupMethod · 0.80
test_ticket2306Method · 0.80

Calls 1

valuesMethod · 0.45

Tested by 1

test_ticket2306Method · 0.64