Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
AdvancedQuery.AdvancedQuery.And Class Reference
Inheritance diagram for AdvancedQuery.AdvancedQuery.And:
Inheritance graph
[legend]
Collaboration diagram for AdvancedQuery.AdvancedQuery.And:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __str__
def addSubquery
def __and__
def __or__
def __invert__

Static Public Attributes

 addSubquery__roles__ = None

Private Member Functions

def _eval
def _eval

Static Private Attributes

string _OP = '&'
 __iand__ = _CompositeQuery.addSubquery

Detailed Description

Definition at line 205 of file AdvancedQuery.py.


Member Function Documentation

def AdvancedQuery.AdvancedQuery._BaseQuery.__and__ (   self,
  other 
) [inherited]
self & other

Definition at line 35 of file AdvancedQuery.py.

00035 
00036   def __and__(self, other):
00037     '''self & other'''
00038     if isinstance(self,And): r = self._clone()
00039     else: r = And(self)
00040     r.addSubquery(other)
00041     return r

Here is the call graph for this function:

~ self

Definition at line 49 of file AdvancedQuery.py.

00049 
00050   def __invert__(self):
00051     '''~ self'''
00052     return Not(self)

def AdvancedQuery.AdvancedQuery._BaseQuery.__or__ (   self,
  other 
) [inherited]
self | other

Definition at line 42 of file AdvancedQuery.py.

00042 
00043   def __or__(self, other):
00044     '''self | other'''
00045     if isinstance(self,Or): r = self._clone()
00046     else: r = Or(self)
00047     r.addSubquery(other)
00048     return r

Here is the call graph for this function:

Reimplemented from AdvancedQuery.AdvancedQuery._BaseQuery.

Definition at line 158 of file AdvancedQuery.py.

00158 
00159   def __str__(self):
00160     return '(%s)' % (' %s ' % self._OP).join([str(q) for q in self._subqueries])

def AdvancedQuery.AdvancedQuery.And._eval (   self,
  context 
) [private]

Reimplemented from AdvancedQuery.AdvancedQuery._BaseQuery.

Definition at line 208 of file AdvancedQuery.py.

00208 
00209   def _eval(self,context):
00210     csq = self._classifySubqueries()
00211     if csq['empty']: return IISet() # empty result
00212     nsq = csq['lookup'] + csq['complex'] + csq['indexed']
00213     notsq = csq['notQ']
00214     if not nsq and not notsq:
00215       # an empty 'And' query
00216       return context._getObjectIds()
00217     if not nsq: nsq.append(notsq.pop())
00218     r = None
00219     for q in nsq: r = intersection(r, q._eval(context))
00220     for q in notsq: r = difference(r, q._query._eval(context))
00221     return r
00222 

Here is the call graph for this function:

Here is the caller graph for this function:

def AdvancedQuery.AdvancedQuery.And._eval (   self,
  context 
) [private]

Reimplemented from AdvancedQuery.AdvancedQuery._BaseQuery.

Definition at line 315 of file AdvancedQuery.py.

00315 
00316     def _eval(self, context):
00317       subqueries = self._subqueries
00318       if not subqueries: return IBTree(context._getObjectIds()) # empty And
00319       if len(subqueries) == 1: return subqueries[0]._eval(context)
00320       search = IAnd(*[sq._eval(context) for sq in subqueries])
00321       search.complete()
00322       return search
00323 
  class Or(Or):

Here is the call graph for this function:

def AdvancedQuery.AdvancedQuery._CompositeQuery.addSubquery (   self,
  query 
) [inherited]

Definition at line 162 of file AdvancedQuery.py.

00162 
00163   def addSubquery(self,query):
00164     assert isinstance(query,_BaseQuery)
00165     self._subqueries.append(query)
00166     return self


Member Data Documentation

Definition at line 207 of file AdvancedQuery.py.

string AdvancedQuery.AdvancedQuery.And._OP = '&' [static, private]

Reimplemented from AdvancedQuery.AdvancedQuery._CompositeQuery.

Definition at line 206 of file AdvancedQuery.py.

Definition at line 161 of file AdvancedQuery.py.


The documentation for this class was generated from the following file: