jeudi 29 octobre 2020

how to display checkbox multi-select in django

if I select all checkbox then my checkbox display only one thing
i want display multi select checkbox in django. what is problem in my code?

in html

<form action="" method="GET">
        <label style="color: gray;" >&nbsp; 확장자 -</label> 
            
    </form>

in views.py

if request.method == 'GET':
        png = {'name' : '.png'}
        jpg = {'name' : '.jpg'}
        gif = {'name' : '.gif'}
        
        file_extention = [png, jpg, gif]
        
        context = {}
        context['file_extention'] = file_extention

        extention_name = request.GET.get('extention_name',None)
        
        
        context['extention_name'] = extention_name
        
        return render(request, 'home/index.html',context)```



Aucun commentaire:

Enregistrer un commentaire