Just for the record, comparing:
spam == eggs
is dangerous if there is any chance that either of them could be a deferred model instance created by Model.objects.raw() query or by .defer() applied to a 'normal' QuerySet.
I put more details here: Django QuerySet .defer() problem - bug or feature?