Filter to get CodeMirror Javascript bundle name needed for a single field.

    Example:
        ::

        {% load djangocodemirror_tags %}
        {{ form.myfield|codemirror_field_js_bundle }}

    Arguments:
        field (django.forms.fields.Field): A form field that contains a widget
            :class:`djangocodemirror.widget.CodeMirrorWidget`.

    Raises:
        CodeMirrorFieldBundleError: If Codemirror configuration form field
        does not have a bundle name.

    Returns:
        string: Bundle name to load with webassets.

def codemirror_field_js_bundle(field):
    """
    Filter to get CodeMirror Javascript bundle name needed for a single field.

    Example:
        ::

        {% load djangocodemirror_tags %}
        {{ form.myfield|codemirror_field_js_bundle }}

    Arguments:
        field (django.forms.fields.Field): A form field that contains a widget
            :class:`djangocodemirror.widget.CodeMirrorWidget`.

    Raises:
        CodeMirrorFieldBundleError: If Codemirror configuration form field
        does not have a bundle name.

    Returns:
        string: Bundle name to load with webassets.
    """
    manifesto = CodemirrorAssetTagRender()
    manifesto.register_from_fields(field)

    try:
        bundle_name = manifesto.js_bundle_names()[0]
    except IndexError:
        msg = ("Given field with configuration name '{}' does not have a "
               "Javascript bundle name")
        raise CodeMirrorFieldBundleError(msg.format(field.config_name))

    return bundle_name