Changes between Version 1 and Version 2 of Ticket #29429
- Timestamp:
- May 22, 2018, 8:30:16 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29429
- Property Owner changed from to
- Property Status new → assigned
-
Ticket #29429 – Description
v1 v2 1 1 When you filter by len like in documentation example: 2 "Post.objects.filter(tags__len=1)" 2 {{{ 3 #!python 4 Post.objects.filter(tags__len=1) 5 }}} 6 3 7 But if you try to annotate something an error pops up example: 4 "Post.objects.all().annotate(tag_len=F('tags__len'))" 5 It really seems that it should work by default, but instead I needed to use something like this 6 "Post.objects.all().annotate(tag_len=Func(F('tags'), 1, function='array_length'))" 8 {{{ 9 #!python 10 Post.objects.all().annotate(tag_len=F('tags__len')) 11 }}} 12 It really seems that it should work by default, but instead I needed to use something like this 13 {{{ 14 #!python 15 Post.objects.all().annotate(tag_len=Func(F('tags'), 1, function='array_length')) 16 }}}