def handle_noargs(self, **options):
        csv_writer = UnicodeCsvWriter()
        report_data = [['mk_pk', 'mk_name', 'is_current', 'current_party', 'total_count', 'monthly_average']]
        for mk in Member.current_knesset.all():
            mk_attendance = MemberAttendance(mk_pk=mk.pk, mk_name=mk.name, is_current=mk.is_current,
                                             current_party=mk.current_party.name,
                                             total_count=mk.total_meetings_count_current_knesset,
                                             monthly_average=mk.committee_meetings_per_month())

            logger.info(u'attendance for {0} {1}'.format(mk.pk, mk.name))
            report_data.append(mk_attendance)

        csv_writer.write(report_data, 'attendance_report.csv', mode='w')
    def handle_noargs(self, **options):
        csv_writer = UnicodeCsvWriter()
        report_data = [
            ['mk_pk', 'mk_name', 'committee', 'is_current', 'current_party', 'total_count']]
        for mk in Member.current_knesset.all():
            member_committees = mk.participated_in_committees_for_current_knesset
            for committee in member_committees:
                mk_attendance = MemberCommitteeAttendance(mk_pk=mk.pk, mk_name=mk.name, is_current=mk.is_current,
                                                          current_party=mk.current_party.name,
                                                          committee=committee,
                                                          total_count=mk.total_meetings_count_for_committee(committee))

                logger.info(u'attendance for {0} {1}'.format(mk.pk, mk.name))
                report_data.append(mk_attendance)

        csv_writer.write(report_data, 'detailed_attendance_report.csv', mode='w')
    def handle_noargs(self, **options):
        csv_writer = UnicodeCsvWriter()
        report_data = [[
            'mk_pk', 'mk_name', 'committee', 'is_current', 'current_party',
            'total_count'
        ]]
        for mk in Member.current_knesset.all():
            member_committees = mk.participated_in_committees_for_current_knesset
            for committee in member_committees:
                mk_attendance = MemberCommitteeAttendance(
                    mk_pk=mk.pk,
                    mk_name=mk.name,
                    is_current=mk.is_current,
                    current_party=mk.current_party.name,
                    committee=committee,
                    total_count=mk.total_meetings_count_for_committee(
                        committee))

                logger.info(u'attendance for {0} {1}'.format(mk.pk, mk.name))
                report_data.append(mk_attendance)

        csv_writer.write(report_data,
                         'detailed_attendance_report.csv',
                         mode='w')