Beispiel #1
0
def _do_reports(abbrev, args):
    from billy import db
    from billy.reports.bills import bill_report
    from billy.reports.legislators import legislator_report
    from billy.reports.committees import committee_report

    report = db.reports.find_one({'_id': abbrev})
    if not report:
        report = {'_id': abbrev}

    if 'legislators' in args.types:
        report['legislators'] = legislator_report(abbrev)
    if 'bills' in args.types:
        report['bills'] = bill_report(abbrev)
    if 'committees' in args.types:
        report['committees'] = committee_report(abbrev)

    db.reports.save(report, safe=True)
Beispiel #2
0
def _do_reports(abbrev, args):
    from billy import db
    from billy.reports.bills import bill_report
    from billy.reports.legislators import legislator_report
    from billy.reports.committees import committee_report

    report = db.reports.find_one({'_id': abbrev})
    if not report:
        report = {'_id': abbrev}

    if 'legislators' in args.types:
        report['legislators'] = legislator_report(abbrev)
    if 'bills' in args.types:
        report['bills'] = bill_report(abbrev)
    if 'committees' in args.types:
        report['committees'] = committee_report(abbrev)

    db.reports.save(report, safe=True)
Beispiel #3
0
def _do_reports(abbrev, args):
    from billy.reports.bills import bill_report
    from billy.reports.votes import vote_report
    from billy.reports.legislators import legislator_report
    from billy.reports.committees import committee_report
    from billy.reports.speeches import speech_report

    report = db.reports.find_one({'_id': abbrev})
    if not report:
        report = {'_id': abbrev}

    if 'legislators' in args.types:
        report['legislators'] = legislator_report(abbrev)
    if 'bills' in args.types:
        report['bills'] = bill_report(abbrev)
        report['votes'] = vote_report(abbrev)
    if 'committees' in args.types:
        report['committees'] = committee_report(abbrev)
    if 'speeches' in args.types:
        report['speeches'] = speech_report(abbrev)

    _log.debug(report)
    db.reports.save(report, safe=True)