Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
AdvancedQuery.AdvancedQuery.Or Class Reference
Inheritance diagram for AdvancedQuery.AdvancedQuery.Or:
Inheritance graph
[legend]
Collaboration diagram for AdvancedQuery.AdvancedQuery.Or:
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 = '|'
 __ior__ = _CompositeQuery.addSubquery

Detailed Description

Definition at line 223 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.Or._eval (   self,
  context 
) [private]

Reimplemented from AdvancedQuery.AdvancedQuery._BaseQuery.

Definition at line 226 of file AdvancedQuery.py.

00226 
00227   def _eval(self,context):
00228     csq = self._classifySubqueries()
00229     if csq['empty']: return context._getObjectIds()
00230     sqs= csq['lookup'] + csq['complex'] + csq['indexed'] + csq['notQ']
00231     if not sqs: return IISet()
00232     if len(sqs) >= 4: return multiunion([q._eval(context) for q in sqs])
00233     r = None
00234     for q in sqs: r = union(r,q._eval(context))
00235     return r
00236 

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from AdvancedQuery.AdvancedQuery._BaseQuery.

Definition at line 324 of file AdvancedQuery.py.

00324 
00325     def _eval(self, context):
00326       subqueries = self._subqueries
00327       if len(subqueries) == 1: return subqueries[0]._eval(context)
00328       search = IOr(*[sq._eval(context) for sq in subqueries])
00329       search.complete()
00330       return search
00331 
  class Not(Not):

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 225 of file AdvancedQuery.py.

string AdvancedQuery.AdvancedQuery.Or._OP = '|' [static, private]

Reimplemented from AdvancedQuery.AdvancedQuery._CompositeQuery.

Definition at line 224 of file AdvancedQuery.py.

Definition at line 161 of file AdvancedQuery.py.


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