Ticket #2937: add_eq_ne_hash_for_anonymous.diff

File add_eq_ne_hash_for_anonymous.diff, 523 bytes (added by favo@…, 9 years ago)
  • django/contrib/auth/models.py

     
    302302   
    303303    def is_authenticated(self):
    304304        return False
     305
     306    def __eq__(self, other):
     307        return isinstance(other, self.__class__)
     308
     309    def __ne__(self, other):
     310        return not self.__eq__(other)
     311
     312    def __hash__(self):
     313        return 1 # instances always the same hash value
Back to Top