def multi_raw(query, params, models, model_to_fields):
    cursor = connections[router.db_for_read(models[0])].cursor()
    cursor.execute(query, params)
    rows = cursor.fetchall()

    for row in rows:
        next_value = iter(row).next
        yield [model_class(**dict((a, next_value())
                           for a in model_to_fields[model_class]))
               for model_class in models]
Scoop multiple model instances out of the DB at once, given a query that
dataset/ETHPy150Open mozilla/django-tidings/tidings/models.py/multi_raw