Back to index

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

List of all members.

Public Member Functions

def __init__
def getEditForm
def edit
def getCriteriaItems

Public Attributes

 id
 field
 value

Static Public Attributes

string meta_type = 'List Criterion'
 operator = None
tuple value = ( '', )
tuple security = ClassSecurityInfo()

Private Member Functions

def _clear

Static Private Attributes

 __implements__ = z2ICriterion
tuple _editableAttributes = ( 'value', 'operator' )

Detailed Description

    Represent a criterion which is a list of values (for an
    'OR' search).

Definition at line 30 of file ListCriterion.py.


Constructor & Destructor Documentation

def CMFTopic.ListCriterion.ListCriterion.__init__ (   self,
  id,
  field 
)

Definition at line 48 of file ListCriterion.py.

00048 
00049     def __init__( self, id, field ):
00050         self.id = id
00051         self.field = field
00052         self._clear()


Member Function Documentation

    Restore to original value.

Definition at line 54 of file ListCriterion.py.

00054 
00055     def _clear( self ):
00056         """
00057             Restore to original value.
00058         """
00059         self.value = ( '', )    # *Not* '()', which won't do at all!
00060         self.operator = None

Here is the caller graph for this function:

def CMFTopic.ListCriterion.ListCriterion.edit (   self,
  value = None,
  operator = None 
)
    Update the value we match against.

Definition at line 70 of file ListCriterion.py.

00070 
00071     def edit( self, value=None, operator=None ):
00072         """
00073             Update the value we match against.
00074         """
00075         if value is None:
00076             self._clear()
00077         else:
00078             if type( value ) == type( '' ):
00079                 value = value.split('\n')
00080             self.value = tuple( value )
00081 
00082         if not operator:
00083             operator = None
00084 
00085         self.operator = operator

Here is the call graph for this function:

Here is the caller graph for this function:

    Return a tuple of query elements to be passed to the catalog
    (used by 'Topic.buildQuery()').

Definition at line 87 of file ListCriterion.py.

00087 
00088     def getCriteriaItems( self ):
00089         """
00090             Return a tuple of query elements to be passed to the catalog
00091             (used by 'Topic.buildQuery()').
00092         """
00093         # filter out empty strings
00094         result = []
00095 
00096         value = tuple( filter( None, self.value ) )
00097         if not value:
00098             return ()
00099         result.append( ( self.field, self.value ), )
00100 
00101         if self.operator is not None:
00102             result.append( ( '%s_operator' % self.field, self.operator ) )
00103 
00104         return tuple( result )
00105 
00106 InitializeClass( ListCriterion )
00107 
00108 # Register as a criteria type with the Topic class
00109 Topic._criteriaTypes.append( ListCriterion )
    Return the name of skin method which renders the form
    used to edit this kind of criterion.

Definition at line 62 of file ListCriterion.py.

00062 
00063     def getEditForm( self ):
00064         """
00065             Return the name of skin method which renders the form
00066             used to edit this kind of criterion.
00067         """
00068         return "listc_edit"


Member Data Documentation

CMFTopic.ListCriterion.ListCriterion.__implements__ = z2ICriterion [static, private]

Definition at line 38 of file ListCriterion.py.

Definition at line 46 of file ListCriterion.py.

Definition at line 50 of file ListCriterion.py.

Definition at line 49 of file ListCriterion.py.

string CMFTopic.ListCriterion.ListCriterion.meta_type = 'List Criterion' [static]

Definition at line 40 of file ListCriterion.py.

Definition at line 41 of file ListCriterion.py.

tuple CMFTopic.ListCriterion.ListCriterion.security = ClassSecurityInfo() [static]

Definition at line 44 of file ListCriterion.py.

Definition at line 42 of file ListCriterion.py.

Definition at line 58 of file ListCriterion.py.


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