コード例 #1
0
def get_excel_dump_report_for_poll(poll):
    poll_responses = get_poll_responses(poll)

    headers = ['Phone Number', 'Name', 'Location', 'Message']
    poll_responses.insert(0, headers)

    return create_workbook(data=poll_responses, encoding='utf8')
コード例 #2
0
def get_excel_dump_report_for_poll(poll):
    poll_responses = get_poll_responses(poll)

    headers = ["Phone Number", "Name", "Location", "Message"]
    poll_responses.insert(0, headers)

    return create_workbook(data=poll_responses, encoding="utf8")
コード例 #3
0
def generate_new_ureporters_spreadsheet():
    if not os.path.exists(UREPORTERS_STATIC_FOLDER):
        os.makedirs(UREPORTERS_STATIC_FOLDER)
    today = datetime.today()
    file_name_base = 'new-ureporters-'
    file_name = '%s%s.xlsx' % (file_name_base, today.date())
    yesterday = today - timedelta(days=1)

    youth_group_poll = Poll.objects.get(name="youthgroup")
    connections = Connection.objects.filter(created_on__gte=yesterday).exclude(contact=None).order_by('contact__created_on')

    export_data = _all_contacts_data(connections, youth_group_poll)
    headers = ['date', 'Id', 'District', 'gender', 'date of birth', 'How did you hear about U-report?']

    common_utils.create_workbook(export_data, UREPORTERS_STATIC_FOLDER + file_name, headers)
    notify_admins('daily-new-ureporters/%s' % file_name, today, yesterday)
コード例 #4
0
def generate_new_ureporters_spreadsheet():
    if not os.path.exists(UREPORTERS_STATIC_FOLDER):
        os.makedirs(UREPORTERS_STATIC_FOLDER)
    today = datetime.today()
    file_name_base = 'new-ureporters-'
    file_name = '%s%s.xlsx' % (file_name_base, today.date())
    yesterday = today - timedelta(days=1)

    youth_group_poll = Poll.objects.get(name="youthgroup")
    connections = Connection.objects.filter(created_on__gte=yesterday).exclude(
        contact=None).order_by('contact__created_on')

    export_data = _all_contacts_data(connections, youth_group_poll)
    headers = [
        'date', 'Id', 'District', 'gender', 'date of birth',
        'How did you hear about U-report?'
    ]

    common_utils.create_workbook(export_data,
                                 UREPORTERS_STATIC_FOLDER + file_name, headers)
    notify_admins('daily-new-ureporters/%s' % file_name, today, yesterday)
コード例 #5
0
def get_per_district_excel_report_for_yes_no_polls(poll_id):
    poll_responses = get_formatted_responses_for_poll_per_district(poll_id)
    return create_workbook(data=poll_responses, encoding='utf8')
コード例 #6
0
def get_per_district_excel_report_for_yes_no_polls(poll_id):
    poll_responses = get_formatted_responses_for_poll_per_district(poll_id)
    return create_workbook(data=poll_responses, encoding="utf8")