So this is my views.py when I use atrakcjatest my images work, but when I try to use the filtered atrakcja(atrakcje_list) it doesnt work and only images dont work, the rest of variables are ok
def map_view(request, trasa_id): trasa = get_object_or_404(Trasa, id_trasy=trasa_id) trasa_atrakcje = Trasa_a_atrakcja.objects.filter(id_trasy=trasa_id) atrakcje = Atrakcja.objects.filter(id_atrakcji__in=[ta.id_atrakcji for ta in trasa_atrakcje]) atrakcje_list = list(atrakcje.values('id_atrakcji', 'nazwa', 'kategoria_id', 'latitude', 'longitude', 'czas_zwiedzania', 'opis', 'miasto_id', 'cena', 'zdjecie_jpeg')) atrakcje_json = json.dumps(atrakcje_list) atrakcjatest = Atrakcja.objects.all() return render(request, 'map.html', {'atrakcje': atrakcje_json, 'trasa': trasa, 'atrakcje_list': atrakcje_list, 'atrakcjatest': atrakcjatest})
I dont understand this bug because when I use objects.all() everything works and also It’s kinda strange that the only thing which doesnt work is Image, I tested the url in a
tag and there is an empty string