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
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')
def _recurse(base, results): for obj in base.values(): if IBaseContent.providedBy(obj) or IVote.providedBy(obj): results.add(obj) _recurse(obj, results)