<commit_before>from django.utils.translation import ugettext_lazy as _
from django import forms

from crispy_forms.layout import Fieldset


# TODO: fetch from API
available_format_choices = (
    ('fgdb', _('ESRI File Geodatabase (FileGDB)')),
    ('shp', _('ESRI Shapefile (shp)')),
    ('gpkg', _('GeoPackage (gpkg)')),
    ('spatialite', _('SQLite based SpatiaLite (spatialite)')),
    ('garmin', _('Garmin navigation & map data (img, tdb)')),
)


def get_export_options():
    return {
        'gis_options': {
            "coordinate_reference_system": "WGS_84",
            "detail_level": 1,
        },
    }


def get_export_formats(selected_options):
    return [option.split('.')[-1] for option in selected_options]


class OrderOptionsMixin(forms.Form):
    formats = forms.MultipleChoiceField(
        label=_("GIS export formats"),
        choices=available_format_choices,
        widget=forms.CheckboxSelectMultiple,
        required=True,
    )

    def form_layout(self):
        return Fieldset(
            _('Extraction options'),
            'formats',
        )
<commit_msg>don't split export format form option values<commit_after>from django.utils.translation import ugettext_lazy as _
from django import forms

from crispy_forms.layout import Fieldset


# TODO: fetch from API
available_format_choices = (
    ('fgdb', _('ESRI File Geodatabase (FileGDB)')),
    ('shp', _('ESRI Shapefile (shp)')),
    ('gpkg', _('GeoPackage (gpkg)')),
    ('spatialite', _('SQLite based SpatiaLite (spatialite)')),
    ('garmin', _('Garmin navigation & map data (img, tdb)')),
)


def get_export_options():
    return {
        'gis_options': {
            "coordinate_reference_system": "WGS_84",
            "detail_level": 1,
        },
    }


def get_export_formats(selected_options):
    return [option for option in selected_options]


class OrderOptionsMixin(forms.Form):
    formats = forms.MultipleChoiceField(
        label=_("GIS export formats"),
        choices=available_format_choices,
        widget=forms.CheckboxSelectMultiple,
        required=True,
    )

    def form_layout(self):
        return Fieldset(
            _('Extraction options'),
            'formats',
        )

{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.003170289855072464, 'mean_word_length': 3.167924528301887, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3307543', 'n_tokens_mistral': 714, 'n_tokens_neox': 691, 'n_words': 156}