Message4994
I ran across this fixing the classic query.edit.html template. There is
a snippet that does:
query.private_for == None
This is never true, even if the _value of private_for is None. The
reason is that because the HTMLProperty classes are old style classes,
python looks for an __eq__ method and, when it doesn't find one (because
neither LinkHTMLProperty nor any of its superclasses define one)
LinkHTMLProperty's __getattr__ is called. That method does:
if not self._value:
<construct MissingValue object and look up attr on it)
This is obviously never going to equal None.
I can fix the template by doing 'not query.private_for', since
__nonzero__ is defined by a subclass, but it seems to me that this is a
bug in LinkHTMLProperty.
This could be fixed by making LinkHTMLProperty a new-style class, but I
don't know if that would have any unexpected consequences. |
|
Date |
User |
Action |
Args |
2014-03-05 20:21:15 | r.david.murray | set | recipients:
+ r.david.murray |
2014-03-05 20:21:15 | r.david.murray | set | messageid: <1394050875.44.0.266176714141.issue2550830@psf.upfronthosting.co.za> |
2014-03-05 20:21:15 | r.david.murray | link | issue2550830 messages |
2014-03-05 20:21:14 | r.david.murray | create | |
|