Created
December 31, 2021 15:20
-
-
Save thorin-schiffer/ec40fe01e8708e01dc67ea4b85721dac to your computer and use it in GitHub Desktop.
Django-plpy annotations
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 F, Func | |
from tests.books.models import Book | |
Book.objects.annotate( | |
max_value=Func(F("amount_sold"), F("amount_stock"), function="pl_max") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment