'Method to help with migration to objects.
Converts a database entity to a formal object.'

@staticmethod
def _from_db_object(context, instance_group, db_inst):

    for field in instance_group.fields:
        if (field in LAZY_LOAD_FIELDS):
            continue
        ignore = {'deleted': False, 'deleted_at': None}
        if ((field in ignore) and (not hasattr(db_inst, field))):
            instance_group[field] = ignore[field]
        else:
            instance_group[field] = db_inst[field]
    instance_group._context = context
    instance_group.obj_reset_changes()
    return instance_group
