def eval_el(el, model):
    """
        el で示された値を model の中から取り出す。見つからない場合は ValueError 例外となる
    """
    context = model
    path = ''
    for part in el.split('.'):
        path = path + '.' + part
        if isinstance(context, list):
            if not part.isdigit():
                raise ValueError('%s: %s should be array but %s' % (el,
                    part, context))
            index = int(part)
            if index < 0 or index >= len(context):
                raise ValueError(
                    '%s: index %d is out of range for model: %s' % (el,
                    index, context))
            context = context[index]
            continue
        if isinstance(context, dict):
            if not part in context:
                raise ValueError('%s: %s key not found in model: %s' % (el,
                    part, context))
            context = context[part]
            continue
        ValueError("model doesn't match %s" % path)
        break
    return context
