Changes between Initial Version and Version 1 of Ticket #29429
- Timestamp:
- May 22, 2018, 8:23:44 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29429 – Description
initial v1 1 1 When you filter by len like in documentation example: 2 Post.objects.filter(tags__len=1) 3 4 Post.objects.all().annotate(tag_len=F('tags__len')) 2 "Post.objects.filter(tags__len=1)" 3 But if you try to annotate something an error pops up example: 4 "Post.objects.all().annotate(tag_len=F('tags__len'))" 5 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')) 6 "Post.objects.all().annotate(tag_len=Func(F('tags'), 1, function='array_length'))"