Example #1
0
def iter_orgs_dict():
    spec = {
        'type': ORG_DEFAULT,
    }

    org_user_count = get_user_count()

    for doc in Organization.collection.find(spec).sort('name'):
        org = Organization(doc=doc)
        org.user_count = org_user_count.get(org.id, 0)
        yield org.dict()