Parse datetime model field to string
Checks the type of the field (date / time / date-time) and returns corresponding value as a string.
- datetime
- string
- parse
Checks the type of the field (date / time / date-time) and returns corresponding value as a string.
Just use it like below: from downloaded_file import SumCase MyClass.objects.aggregate( sum1=SumCase('salary', case='salary < 4', when=True), sum1=SumCase('salary', case='type', when='director'), )