Changes between Initial Version and Version 1 of Ticket #29500, comment 1
- Timestamp:
- Jun 18, 2018, 5:42:20 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29500, comment 1
initial v1 5 5 I'll guess it'll be this: 6 6 7 ``` 7 8 9 {{{ 8 10 >>> None ** None 9 11 Traceback (most recent call last): 10 12 File "<console>", line 1, in <module> 11 13 TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'NoneType' 12 ``` 14 15 }}} 16 13 17 14 18 If so we may just have to workaround it by using a function for `pow` which checks for `None`. … … 16 20 This works: 17 21 18 ``` 22 {{{ 19 23 >>> TestModel.objects.annotate(null=Value(None,output_field=models.IntegerField())).values(pow=models.F('null')).first() 20 24 {'pow': None} 21 ``` 25 }}} 22 26 23 27 So it's just the `**` operation.