class UserAccount(db.Model):

    def __eq__(self, other):
        if isinstance(other, UserAccount):
            return self.user_id == other.user_id
return NotImplemented

def __ne__(self, other):
    result = self.__eq__(other)
if result is NotImplemented:
    pass
How to override equals() in google app engine data model type?