Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

Changeset 218

Show
Ignore:
Timestamp:
06/14/06 02:00:18
Author:
fumanchu
Message:

Expression "and" and "or" now merge kwtypes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/logic.py

    r217 r218  
    231231     
    232232    def __init__(self, func=None, kwtypes=None): 
    233         """Expression(func, [kwtypes]={}). func(obj, [**kw]) must return bool. 
     233        """Expression(func, [kwtypes={}]). func(obj, [**kw]) must return bool. 
    234234         
    235235        func: a function, with one positional arg and optional keyword args, 
     
    265265        ag.and_combine(other.func) 
    266266        agfunc = ag.function() 
    267         return Expression(agfunc) 
     267        newkwtypes = self.kwtypes.copy() 
     268        newkwtypes.update(other.kwtypes) 
     269        return Expression(agfunc, newkwtypes) 
    268270    __add__ = __and__ 
    269271     
     
    275277        ag.or_combine(other.func) 
    276278        agfunc = ag.function() 
    277         return Expression(agfunc) 
     279        newkwtypes = self.kwtypes.copy() 
     280        newkwtypes.update(other.kwtypes) 
     281        return Expression(agfunc, newkwtypes) 
    278282     
    279283    def bind_args(self, **kwargs):