Ticket #982: __init__.diff
File __init__.diff, 825 bytes (added by , 19 years ago) |
---|
-
__init__.py
old new 592 592 # Create the default class methods. 593 593 attrs['__init__'] = curry(method_init, opts) 594 594 attrs['__eq__'] = curry(method_eq, opts) 595 attrs['__ne__'] = curry(method_ne, opts) 595 596 attrs['save'] = curry(method_save, opts) 596 597 attrs['save'].alters_data = True 597 598 attrs['delete'] = curry(method_delete, opts) … … 845 846 def method_eq(opts, self, other): 846 847 return isinstance(other, self.__class__) and getattr(self, opts.pk.column) == getattr(other, opts.pk.column) 847 848 849 def method_ne(opts, self, other): 850 return not method_eq(opts, self, other) 848 851 def method_save(opts, self): 849 852 # Run any pre-save hooks. 850 853 if hasattr(self, '_pre_save'):