Lookups using m2m relationships return incorrect results with Sqlite on Windows
|Reported by:||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Consider the following model
from django.db import models from django.contrib.auth.models import User class Book(models.Model): name = models.CharField(max_length = 255, unique = True) users = models.ManyToManyField(User)
m2m lookups using
username attribute of
User are returning incorrect results with Sqlite only on Windows. It seems that the filtering condition is being ignored and all books are being returned for any given username.
Book.objects.filter(users__username = <some username> )
as well as
Book.objects.filter(users__username_exact = <some username> )
are not working properly.
I have added tests for the same.