[Django]-Django compare query with F objects adds extra not null check

0๐Ÿ‘

I think you must have null=True in your model definition for email. So, the easiest way to fix this is to delete that null=True, migrate then try again. Thus, if email is None, it will be '' instead of None, then F() will work.

Another way is to use the Q() query, but it will cost in Python memory.

๐Ÿ‘คzhaochy

Leave a comment