This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models import IntegerField, Subquery | |
class SubqueryCount(Subquery): | |
template = "(SELECT COUNT(*) FROM (%(subquery)s) _count)" | |
output_field = IntegerField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.python.org/nominations/elections/2021-python-software-foundation-board/nominees/debora-azevedo/ | |
https://www.python.org/nominations/elections/2021-python-software-foundation-board/nominees/tania-allard/ | |
https://www.python.org/nominations/elections/2022-python-software-foundation-board/nominees/kushal-das/ | |
https://www.python.org/nominations/elections/2022-python-software-foundation-board/nominees/jannis-leidel/ | |
https://www.python.org/nominations/elections/2021-python-software-foundation-board/nominees/joannah-nanjekye/ | |
https://www.python.org/nominations/elections/2022-python-software-foundation-board/nominees/dawn-wages/ | |
https://www.python.org/nominations/elections/2022-python-software-foundation-board/nominees/simon-willison/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# There will come a time when you want to show more information on the admin | |
# list view, but performing the annotation on the entire queryset kills | |
# performance. These classes will allow you to apply a QuerySet annotation | |
# to only those objects that are rendered on the current page. | |
# Constraints: | |
# - This adds one additional query to your request. | |
# - The annotated columns can't be used in ordering. | |
# - You need to define functions to access the annotated fields on the object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code coverage badges |