How to remove pk in django datalist?

I output datalist, but output pk. I read that it can be removed in data-value like this https://stackoverflow.com/a/48076273/9653855 How can I rewrite the code so that my datalist is displayed in this format <option data-value="1" value="DjangoOneLove"></option>?

enter image description here

my forms

class ListTextWidget(forms.Select):
    template_name = 'include/_forms_orders_datalist.html'

    def format_value(self, value):
        if value == '' or value is None:
            return ''
        if self.is_localized:
            return formats.localize_input(value)
        return str(value)

class ChoiceTxtField(forms.ModelChoiceField):
    widget=ListTextWidget()

class SimpleOrderAddForm(forms.ModelForm):
        #service = forms.ModelChoiceField(queryset=Service.objects.all(), widget=ListTextWidget())
        service = ChoiceTxtField(queryset=Service.objects.order_by('-used'))   
    
        class Meta:
            model = Orders
            fields = ['service'] 

my forms_orders_datalist.html

<input id="ajax_input_{{ widget.name }}" list="{{ widget.name }}" autocomplete="off"
    {% if widget.value != None %} name="{{ widget.name }}" value="{{ widget.value|stringformat:'s' }}"{% endif %}
    {% include "django/forms/widgets/attrs.html" %}>
    <span class="badge rounded-pill bg-warning text-dark" id="ajax-{{ widget.name }}" name="ajax-{{ widget.name }}"></span>

<datalist id="{{ widget.name }}">
    {% for group_name, group_choices, group_index in widget.optgroups %}
        {% if group_name %}
<optgroup label="{{ group_name }}">{% endif %}{% for option in group_choices %}
  {% include option.template_name with widget=option %}{% endfor %}{% if group_name %}
</optgroup>{% endif %}{% endfor %}
</datalist>
Back to Top