39π
The problem is in functools.py file. This file is from Python. I have just installed a new version of python 2.7.5 and this file is wrong (I have another β older installation of python 2.7.5 and there the file functools.py is correct)
To fix the problem replace this (about line 56 in python\Lib\fuctools.py):
convert = {
'__lt__': [('__gt__', lambda self, other: other < self),
('__le__', lambda self, other: not other < self),
('__ge__', lambda self, other: not self < other)],
'__le__': [('__ge__', lambda self, other: other <= self),
('__lt__', lambda self, other: not other <= self),
('__gt__', lambda self, other: not self <= other)],
'__gt__': [('__lt__', lambda self, other: other > self),
('__ge__', lambda self, other: not other > self),
('__le__', lambda self, other: not self > other)],
'__ge__': [('__le__', lambda self, other: other >= self),
('__gt__', lambda self, other: not other >= self),
('__lt__', lambda self, other: not self >= other)]
}
to that:
convert = {
'__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),
('__le__', lambda self, other: self < other or self == other),
('__ge__', lambda self, other: not self < other)],
'__le__': [('__ge__', lambda self, other: not self <= other or self == other),
('__lt__', lambda self, other: self <= other and not self == other),
('__gt__', lambda self, other: not self <= other)],
'__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),
('__ge__', lambda self, other: self > other or self == other),
('__le__', lambda self, other: not self > other)],
'__ge__': [('__le__', lambda self, other: (not self >= other) or self == other),
('__gt__', lambda self, other: self >= other and not self == other),
('__lt__', lambda self, other: not self >= other)]
}
Read also: http://regebro.wordpress.com/2010/12/13/python-implementing-rich-comparison-the-correct-way/
2π
You have likely run into this bug: http://bugs.python.org/issue10042
Exactly what happens is hard to tell without debugging, bit Iβd guess one of the things that should be a field isnβt in this line:
self.local_fields.insert(bisect(self.local_fields, field), field)
- Installing Django with pip
- Load Balancing Multiple Django Webservers
- How to unit test methods inside django's class based views?
2π
I had this problem here, today.
We were using django1.5.1 and python2.7.2 too.
At first we were installed django1.4 and it worked, but the project has django1.5 features, so itβs not a total solution.
To solve this we installed python2.7.5
and it worked fine!
- Display query string values in django templates
- Clone an inherited django model instance
- Using Django's m2m_changed to modify what is being saved pre_add
- Reading file data during form's clean method