N
N
nurzhannogerbek2017-04-29 21:34:24
Django
nurzhannogerbek, 2017-04-29 21:34:24

Editable field with a choice?

Hello!
How to create a similar field in Django, where you can select from a list and edit if necessary?
cb169ad938484b489d1409b745089b71.png
For now, I found the django-floppyforms project and tried it out. In general, it has the same effect, it uses datalist , which does not lend itself to css styles. Is it possible to replace datalist with a ul list ?
forms.py:

class SymbolForm(forms.ModelForm):
    symbol = floppyforms.CharField(widget=floppyforms.TextInput(datalist=['A', 'B', 'C'], attrs={'autocomplete': 'off'}))

    class Meta:
        model = Symbol
        fields = ('symbol ')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question