Changes between Initial Version and Version 1 of Ticket #29429


Ignore:
Timestamp:
May 22, 2018, 8:23:44 AM (7 years ago)
Author:
creative3000
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29429 – Description

    initial v1  
    11When you filter by len like in documentation example:
    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'))
     2"Post.objects.filter(tags__len=1)"
     3But if you try to annotate something an error pops up example:
     4"Post.objects.all().annotate(tag_len=F('tags__len'))"
    55It 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'))"
Back to Top