def get_all_testplans():
    dbc = db_model.connect()
    testplans = [t for t in dbc.testplan.find()]
    for t in testplans:
        # Find and append any sessions within each testplan
        sessions = [s for s in dbc.session.find({"testplan": t['_id']})]

        for s in sessions:  # Translate _id to id
            s['id'] = str(s.pop('_id'))
        t['id'] = str(t.pop('_id'))

    return JsonResponse({"testplans": testplans}, status=200)
Save aggregated type information to the datastore if changed.
dataset/ETHPy150Open emccode/heliosburn/heliosburn/django/hbproject/api/views/testplan.py/get_all_testplans--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/datastore_admin/backup_handler.py/SchemaAggregationPool.flush