and i got it what i wanted but it is only facilitiess id and not its name, 
so i need to show up its name and not id.
On Monday, 17 May 2021 at 08:21:25 UTC+4 bharath...@gmail.com wrote:

> Hi,
>
> Use a select box with multiple attribute instead of ul and li. Loop 
> through options. Please go through this. 
> https://www.w3schools.com/tags/att_select_multiple.asp#:~:text=For%20windows%3A%20Hold%20down%20the,button%20to%20select%20multiple%20options
>
> All the best 
>
> On Sun, May 16, 2021 at 8:50 PM Gegi Esitashvili <gegiesi...@gmail.com> 
> wrote:
>
>> hello everyone, i am using django allauth, also i have installed 
>> multiselectfield and trying show my facilities on the site.
>>
>> this is my models.py
>>
>> class Hotel(models.Model):
>> name = models.CharField(max_length=128)
>> description = models.TextField()
>> stars = models.IntegerField()
>> price = models.IntegerField()
>> picture = models.ImageField(upload_to='images', 
>> default="images/124180566_3771168516249284_3976912378791517206_o.jpg")
>> HOTEL_TYPE = (
>> ("Free WiFi", "free wiFi"),
>> ("Free Parking", "Free Parking"),
>> )
>> popular_facilities = MultiSelectField(choices=HOTEL_TYPE)
>>
>>
>> this is my views.py 
>>
>> def see_more(request, id):
>> seemore = Hotel.objects.get(id=id)
>> reviews = HotelReview.objects.filter(review=id, permission=True)[:2]
>> facilities = seemore.popular_facilities
>> form = HotelReviewForm()
>> if request.method == "GET":
>> form = HotelReviewForm(request.GET or None) #request.FILES მედიას 
>> ატვირთვა თუ გვინდა
>> if form.is_valid():
>> data = form.save(commit=False)
>> data.review = seemore
>> data.name = form.cleaned_data.get("name")
>> data.email = form.cleaned_data.get('email')
>> data.comment = form.cleaned_data.get('comment')
>> data.rating_number = form.cleaned_data.get('rating_number')
>> data.permission = True
>> data.save()
>>
>> return redirect('hotel:seemore', id)
>>
>> context = {
>> 'seemore':seemore,
>> 'reviews':reviews,
>> 'form':form,
>> 'facilities':facilities
>> }
>> return render(request, 'hotel/seemore.html', context)
>>
>> and this is my html
>>
>> <p class="se-p">Popular Facilities</p>
>> <ul>
>> {% for facilitie in facilities %}
>> <li class="fac"><i class="fas fa-swimmer iconsize"></i>{{ facilitie 
>> }}</li>
>> {% endfor %}
>>
>> and this is what is showed up[image: 1.PNG]
>>
>>
>>
>> can anyone help me?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/db5fa916-7676-4ba8-bea0-05f4e0f8af8cn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/db5fa916-7676-4ba8-bea0-05f4e0f8af8cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Thanks and Regards
>
> J. Ranga Bharath
> cell: 9110334114
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ea022731-01bf-44ca-9b9a-dfb9bf4761ecn%40googlegroups.com.

Reply via email to