Exemplo n.º 1
0
 def getData(self):
     """
     return the data of the query
     """
     data_list = []
     results = self.query.all()
     formatter = self.request.locale.dates.getFormatter('date', 'short')
     for result in results:
         data ={}
         data['subject'] = result.short_name
         if ICommittee.providedBy(result.group):
             #http://localhost:8081/business/committees/obj-194/calendar/group/sittings/obj-5012/schedule
             data['url'] = 'committees/obj-%i/calendar/group/sittings/obj-%i/schedule' % (
                 result.group.group_id, result.sitting_id)
         else:
             #http://localhost:8081/calendar/group/sittings/obj-5011/schedule
             data['url'] = 'calendar/obj-%i/schedule' % result.sitting_id
         data['items'] = ''
         data['status'] = misc.get_wf_state(result)
         data['status_date'] = formatter.format(result.status_date)
         data['owner'] = ""
         data['type'] =  result.group.type
         data['group'] = u"%s %s" %(result.group.type.capitalize(), 
             result.group.short_name)
         data['date'] = u"%s %s" % (
             result.start_date.strftime('%Y-%m-%d %H:%M'), 
             #formatter.format(
             result.sitting_type.sitting_type)
         if type(result) == domain.Question:
             data['to'] = result.ministry.short_name
         else:
             data['to']= u""
         data_list.append(data)
     return data_list
Exemplo n.º 2
0
 def visible(self):
     return not (ICommittee.providedBy(self.group()))
Exemplo n.º 3
0
 def visible(self):
     return not(ICommittee.providedBy(self.group()))