Example #1
0
def get_committee_id(level, abbr, name, chamber):
    spec = {"state": abbr}
    comms = db.committees.find(spec)
    for committee in comms:
        c = committee['committee']
        if compare_committee(name, c):
            return committee['_id']
    return None
Example #2
0
def get_committee_id_alt(level, abbr, name, chamber):
    spec = {"state": abbr, "chamber": chamber}
    if chamber is None:
        del(spec['chamber'])
    comms = db.committees.find(spec)
    for committee in comms:
        c = committee['committee']
        if compare_committee(name, c):
            return committee['_id']
    if not chamber is None:
        return get_committee_id_alt(level, abbr, name, None)
    return None