1👍
✅
Model.objects.filter()
returns a QuerySet. If you are sure that a filter returns only one model you can do KleedkamerIndeling.objects.get(speel_ronde=25)
. Otherwise the QuerySet behaves like a list, that means you can for example take out the first one (kleedkamer1 = queryset[0].kleedkamer_1
).
0👍
Queryset is a list. So you have to take 1st index from that list, like:
def vandaag(request):
queryset = KleedkamerIndeling.objects.all().filter(speel_ronde=25)[0]
- [Answer]-Django. Sending email with an application
- [Answer]-Do not know how to implement this MVC pattern
Source:stackexchange.com