Changes between Initial Version and Version 1 of Ticket #29500, comment 1


Ignore:
Timestamp:
Jun 18, 2018, 5:42:20 AM (7 years ago)
Author:
Carlton Gibson

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29500, comment 1

    initial v1  
    55I'll guess it'll be this:
    66
    7 ```
     7
     8
     9{{{
    810>>> None ** None
    911Traceback (most recent call last):
    1012  File "<console>", line 1, in <module>
    1113TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'NoneType'
    12 ```
     14
     15}}}
     16
    1317
    1418If so we may just have to workaround it by using a function for `pow` which checks for `None`.
     
    1620This works:
    1721
    18 ```
     22{{{
    1923>>> TestModel.objects.annotate(null=Value(None,output_field=models.IntegerField())).values(pow=models.F('null')).first()
    2024{'pow': None}
    21 ```
     25}}}
    2226
    2327So it's just the `**` operation.
Back to Top