Questions tagged as 'django-views'

1
answer

Timezone works locally, but not in pythonanywhere (DJango)

I have a queryset that lists all sales today: from django.utils import timezone class VentaToday(ListView): queryset = Venta.objects.filter(fecha=timezone.now()).order_by('-id') template_name = 'venta/venta_today.html' In local,...
asked by 24.03.2018 / 15:08
1
answer

Calculate fields in view and pass the query to the template

I am using Django 1.4 and I have a query that brings several data from the db, including one that can have 3 different values (type). Depending on this data I make a conditional and calculate some values (accommodation and diet) to send to the t...
asked by 24.02.2018 / 07:22