Django query single underscore behaving like double underscore?
问题 I made a typo in my code recently and noticed that I got the same behavior, so I was wondering what the difference between single and double underscores are in django queries. >>> underscore = MyModel.objects.filter(foreign_key_id=var) >>> double_underscore = MyModel.objects.filter(foreign_key__id=var) >>> underscore == double_underscore False >>> list(underscore) == list(double_underscore) True I'm not sure what equality method is being used to compare the querysets, but when I convert to