Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
ATContentTypes.criteria.date.ATDateCriteria Class Reference
Inheritance diagram for ATContentTypes.criteria.date.ATDateCriteria:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.criteria.date.ATDateCriteria:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getCriteriaItems

Static Public Attributes

tuple security = ClassSecurityInfo()
 schema = ATDateCriteriaSchema
string meta_type = 'ATFriendlyDateCriteria'
string archetype_name = 'Friendly Date Criteria'
string shortDesc = 'Relative date'

Static Private Attributes

tuple __implements__ = ATBaseCriterion.__implements__+(IATTopicSearchCriterion, )

Detailed Description

A relative date criterion

Definition at line 115 of file date.py.


Member Function Documentation

Return a sequence of items to be used to build the catalog query.

Definition at line 128 of file date.py.

00128 
00129     def getCriteriaItems(self):
00130         """Return a sequence of items to be used to build the catalog query.
00131         """
00132         if self.value is not None:
00133             field = self.Field()
00134             value = self.Value()
00135 
00136             # Negate the value for 'old' days
00137             if self.getDateRange() == '-':
00138                 value = -value
00139 
00140             date = DateTime() + value
00141             current_date = DateTime()
00142 
00143             operation = self.getOperation()
00144             if operation == 'within_day':
00145                 date_range = ( date.earliestTime(), date.latestTime() )
00146                 return ( ( field, {'query': date_range, 'range': 'min:max'} ), )
00147             elif operation == 'more':
00148                 if value != 0:
00149                     range_op = (self.getDateRange() == '-' and 'max') or 'min'
00150                     return ( ( field, {'query': date.earliestTime(), 'range': range_op} ), )
00151                 else:
00152                     return ( ( field, {'query': date, 'range': 'min'} ), )
00153             elif operation == 'less':
00154                 if value != 0:
00155                     date_range = (self.getDateRange() == '-' and
00156                                   (date.earliestTime(), current_date)
00157                                   ) or (current_date, date.latestTime())
00158                     return ( ( field, {'query': date_range, 'range': 'min:max'} ), )
00159                 else:
00160                     return ( ( field, {'query': date, 'range': 'max'} ), )
00161         else:
00162             return ()
00163 
00164 registerCriterion(ATDateCriteria, DATE_INDICES)

Here is the call graph for this function:


Member Data Documentation

tuple ATContentTypes.criteria.date.ATDateCriteria.__implements__ = ATBaseCriterion.__implements__+(IATTopicSearchCriterion, ) [static, private]

Definition at line 119 of file date.py.

string ATContentTypes.criteria.date.ATDateCriteria.archetype_name = 'Friendly Date Criteria' [static]

Definition at line 124 of file date.py.

string ATContentTypes.criteria.date.ATDateCriteria.meta_type = 'ATFriendlyDateCriteria' [static]

Definition at line 123 of file date.py.

Definition at line 122 of file date.py.

tuple ATContentTypes.criteria.date.ATDateCriteria.security = ClassSecurityInfo() [static]

Definition at line 121 of file date.py.

string ATContentTypes.criteria.date.ATDateCriteria.shortDesc = 'Relative date' [static]

Definition at line 125 of file date.py.


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