Files
Jeas Benjamin Jeanniton a2d654e9d5 Improves the Admin section and the Data model
Add the market place application
Start Improving the dashboard
Edit the data model to make it more suited to the reality of the CNSA
Add Support for Alert and notification
Add Import-Export functionality
Achieve many minor changes to make the application more ergonomic
2016-03-17 03:00:03 -04:00

41 lines
1.1 KiB
Python

from django.shortcuts import render
from base.models import Limite
from hydromet.models import Observation
import datetime
# Create your views here.
def home(request):
return render(request, "public/index.html", {'menu_active':'accueil'})
def faq(request):
return render(request, "public/faq.html", {'menu_active':'faq'})
def pluviometrie(request):
departement_lst = Limite.objects.filter(typelimite__nom='Département');
month_lst = []
selDate = datetime.date.today()
for x in range(0,12):
first = selDate.replace(day=1)
last_month = first - datetime.timedelta(days=1)
month_lst.append({'key': last_month.strftime("%Y-%m-01"), 'val': last_month.strftime("%B %Y")})
selDate = last_month
return render(request, "public/pluviometrie.html", {'menu_active': 'pluviometrie','dep_lst': departement_lst, 'month_lst': month_lst })
def imp(request):
recupAll = Observation.objects.select_related('idStation')
dd = []
for e in recupAll:
dd.append(e)
return render(request, "public/test.html", {'val': dd})