Logo Search packages:      
Sourcecode: zope-advancedquery version File versions  Download package

def AdvancedQuery::ranking::_RankByQueries::__init__ (   self,
each spec is a pair *query*, *value*.

Reimplemented in AdvancedQuery::ranking::RankByQueries_Max.

Definition at line 44 of file ranking.py.

    '''each spec is a pair *query*, *value*.'''
    l = []; sum = 0
    for q,v in specs:
      if not isinstance(q, _BaseQuery):
        raise TypeError('Query must be an AdvancedQuery')
      if not isinstance(v, (int, float, long)):
        raise TypeError('Query value must be a float')
      if v < 0: raise ValueError('Query value must not be negative')
      if not v: continue
      l.append((v,q)); sum += v
    self._specs = l; self._sum = sum

Generated by  Doxygen 1.6.0   Back to index