Reviewers: ,
Please review this at http://codereview.tryton.org/80001/ Affected files: M trytond/pyson.py Index: trytond/pyson.py =================================================================== --- a/trytond/pyson.py +++ b/trytond/pyson.py @@ -18,6 +18,39 @@ def eval(dct, context): raise NotImplementedError + def __invert__(self): + return Not(Bool(self)) + + def __and__(self, other): + return And(self, other) + + def __or__(self, other): + return Or(self, other) + + def __eq__(self, other): + return Equal(self, other) + + def __gt__(self, other): + return Greater(self, other) + + def __ge__(self, other): + return Greater(self, other, True) + + def __lt__(self, other): + return Less(self, other) + + def __le__(self, other): + return Less(self, other, True) + + def get(self, k, d=''): + return Get(self, k, d) + + def in_(self, obj): + return In(self, obj) + + def has_key(self, k): + return In(k, self) + class PYSONEncoder(json.JSONEncoder): -- [email protected] mailing list
