Django

Code

Changeset 1547

Show
Ignore:
Timestamp:
12/04/05 21:39:18 (4 years ago)
Author:
adrian
Message:

Fixed #982 -- Added 'ne' support for Django models, which apparently wasn't working on Python 2.3 (?)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/meta/__init__.py

    r1516 r1547  
    730730        attrs['__init__'] = curry(method_init, opts) 
    731731        attrs['__eq__'] = curry(method_eq, opts) 
     732        attrs['__ne__'] = curry(method_ne, opts) 
    732733        attrs['save'] = curry(method_save, opts) 
    733734        attrs['save'].alters_data = True 
     
    978979def method_eq(opts, self, other): 
    979980    return isinstance(other, self.__class__) and getattr(self, opts.pk.attname) == getattr(other, opts.pk.attname) 
     981 
     982def method_ne(opts, self, other): 
     983    return not method_eq(opts, self, other) 
    980984 
    981985def method_save(opts, self):