Changes between Initial Version and Version 1 of Ticket #28731


Ignore:
Timestamp:
Oct 21, 2017, 1:00:06 PM (7 years ago)
Author:
Tom van Bussel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28731 – Description

    initial v1  
    22{{{
    33q = Q() # Dynamically constructed, possibly empty
    4 x = TestModel.objects.annotate(test_name=When(q, then=Value(True)), default=Value(False), output_field=BooleanField())).all()
     4x = TestModel.objects.annotate(test_name=Case(When(q, then=Value(True)), default=Value(False), output_field=BooleanField())).all()
    55print(x)
    66}}}
Back to Top