We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
MyModel.objects.filter(content='...')
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example:
Given a model with a compressed field named content:
content
>>> m = MyModel.objects.last() >>> m.id 123 >>> m.content 'abc' >>> len(list(MyModel.objects.filter(content=m.content))) 0
That should be at least 1, not 0.
These still work though, as documented:
>>> len(list(MyModel.objects.filter(content__in=[m.content]))) 1 >>> len(list(MyModel.objects.filter(content__startswith=m.content))) 1
The text was updated successfully, but these errors were encountered:
MyModel.objects.filter(content=m.content)
I suspect you may need to rewrite this query as one of:
MyModel.objects.filter(content__exact=m.content)
MyModel.objects.filter(content__iexact=m.content)
MyModel.objects.filter(content=Compress(m.content))
Even assuming the above is true, I agree that it's confusing for the original query to not work. I'll plan to update the documentation.
Sorry, something went wrong.
MyModel.objects.filter(content__exact=m.content) MyModel.objects.filter(content__iexact=m.content)
Actually these won't work because apparently neither the exact nor the iexact filters are currently overridden by the implementation.
That should be fixed too, since __exact and __iexact are useful.
__exact
__iexact
No branches or pull requests
Example:
Given a model with a compressed field named
content
:That should be at least 1, not 0.
These still work though, as documented:
The text was updated successfully, but these errors were encountered: