Add ability to use Rule in a boolean operation: "if Rule()" will be equivalent to "if Rule.apply()"
svn: r12845
This commit is contained in:
parent
a62b15353e
commit
7be4c7a2bf
@ -69,9 +69,8 @@ class Rule(object):
|
||||
def apply(self, db, person):
|
||||
return True
|
||||
|
||||
#def __nonzero__(self, db, person):
|
||||
# return self.apply(db, person)
|
||||
|
||||
__nonzero__ = apply
|
||||
|
||||
def display_values(self):
|
||||
v = ( '%s="%s"' % ((_(self.labels[ix]),)*2)
|
||||
for ix in xrange(len(self.list)) if self.list[ix] )
|
||||
|
Loading…
Reference in New Issue
Block a user