mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
![]() Instead of loading all QuerySet results in memory, count the number of entries. This adds an extra query when list() or tuple() is called on the choices (because both call __len__() then __iter__()) but uses less memory since the QuerySet results won't be cached. In most cases, the choices will only be iterated on, meaning that __len__() won't be called and only one query will be executed. |
||
---|---|---|
.. | ||
__init__.py | ||
models.py | ||
test.png | ||
test2.png | ||
test_modelchoicefield.py | ||
test_uuid.py | ||
tests.py |