Invalid query is generated: For field=BitField
See original GitHub issueHi all, thanks for your work on this. Noticed the below when testing version 2.8.1 with not yet supported Django 3.1.1. However, it works as expected up to version 3.0.10. Just adding this here fwiw or any that misinterpret “Django 2.2 or newer” 😃.
models.py:
class Book(models.Model):
BitField = models.BooleanField(db_column="BitField", default=0)
query:
queryset = Book.objects.filter(BitField=True)
Generated T-SQL (Django 3.1.1):
SELECT TOP 10 dbo.Book.PK, dbo.Book.BitField
FROM dbo.Book
WHERE NOT dbo.Book.BitField
-- For Django up to 3.0.10 the correct T-SQL is generated:
-- ... WHERE dbo.Book.BitField = 0
Error: An expression of non-boolean type specified in a context where a condition is expected, near ‘BitField’.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:7
Top Results From Across the Web
Issues · ESSolutions/django-mssql-backend - GitHub
AttributeError: 'Query' object has no attribute 'explain_query'. #125 opened on May 4 by DiegoMagg ... Invalid query is generated: For field=BitField.
Read more >I get an "Error! Invalid Query!" message when there is a ...
Diagnose this problem by going in the Salesforce section on Jira > Connections > Configure > Click on the "Fields" of the object...
Read more >BPF CO-RE reference guide - Andrii Nakryiko's Blog
A practical reference guide to using the full power of BPF CO-RE (Compile Once – Run Everywhere).
Read more >Apache Spark 3.0 Adaptive Query Execution - Morioh
It optimizes the query logically then generates a range of physical plans and ... An InvalidOptionException will be thrown in case an invalid...
Read more >Logonid Record Fields - TechDocs - Broadcom Inc.
Specifies the number of system accesses made since this logonid was ... Through the IMS AUTH operand, a site can choose to use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had the same issue. We had to downgrade to 3.0.10 version of Django and the problem disappeared.
Dependencies (Not working):
Issue exists in django3.1.6 also. When we can expect the fixed version in PyPI