def _get_field(instance, field):
    """
    This is here to support ``MarkupField``. It's a little ugly to
    have that support baked-in; other option would be to have a
    generic way (via setting?) to override how attribute values are
    fetched from content model instances.

    """
    
    value = getattr(instance, field)
    if hasattr(value, 'raw'):
        value = value.raw
    return value