示例#1
0
def get_end_time(obj, default):
    """ UNIX timestamp from end_time. """
    if IBaseContent.providedBy(obj):
        value = obj.get_field_value('end_time', default)
        if value and value != default:
            return timegm(value.timetuple())
    return default
示例#2
0
 def get_moderator_actions(self, context):
     """ A.k.a. the cogwheel-menu. context might be a brain here, but the view component must have an object context."""
     if not IBaseContent.providedBy(context):
         #Assume brain - might need to change this later
         context = find_resource(self.root, context['path'])
     return self.render_single_view_component(context, self.request, 'main',
                                              'moderator_actions')
示例#3
0
def get_end_time(obj, default):
    """ UNIX timestamp from end_time. """
    if IBaseContent.providedBy(obj):
        value = obj.get_field_value('end_time', default)
        if value and value != default:
            return timegm(value.timetuple())
    return default
示例#4
0
 def get_moderator_actions(self, context):
     """ A.k.a. the cogwheel-menu. context might be a brain here, but the view component must have an object context."""
     if not IBaseContent.providedBy(context):
         #Assume brain - might need to change this later
         context = find_resource(self.root, context['path'])
     return self.render_single_view_component(context, self.request, 'main', 'moderator_actions')
示例#5
0
 def _recurse(base, results):
     for obj in base.values():
         if IBaseContent.providedBy(obj) or IVote.providedBy(obj):
             results.add(obj)
         _recurse(obj, results)
示例#6
0
 def _recurse(base, results):
     for obj in base.values():
         if IBaseContent.providedBy(obj) or IVote.providedBy(obj):
             results.add(obj)
         _recurse(obj, results)