drought_backup/predict/views.py

14 lines
403 B
Python
Raw Normal View History

from dashboard.models import Spi, Finance
2018-07-09 03:52:42 +00:00
from django.shortcuts import render
def ghyc(request):
month = request.GET.get('month', '1')
months = range(1, 13)
year = request.GET.get('year', '1979')
years = range(1979, 2018)
spis = Spi.objects.filter( month=month)
return render(request,'predict/ghyc.html',{'month':month,'months':months,'spis':spis,'year':year,'years':years})