Version beta apres la presentation CNSA

This commit is contained in:
Esdras1995 committed 2015-10-29 22:42:22 -04:00
1 parent 59a34490ce
commit 6a5beed032
5 files changed
+85 -39

No files matched your search

+3
View File
@@ -24,10 +24,13 @@ class CommuneAdmin(admin.ModelAdmin):
class SectionCommunaleAdmin(admin.ModelAdmin):
#Called my form in the admin and set a column for each fields
list_display = ("commune", "sectionCommunale", "nomOfficiel", "id_code", "description")
search_fields = ["sectionCommunale"]
form = SectionCommunaleForm
class SiteSentinelleAdmin(admin.ModelAdmin):
#Called my form in the admin and set a column for each fields
list_display = ("sectionCommunale", "localite", "latitude", "longitude", "hauteur")
+33 -33
View File
@@ -11,40 +11,40 @@ import csv
#ts = TypeStationPluviometrique.objects.all()[0]
with open('scripts/depFakeDatas.csv', 'r+') as csvfile:
reader = csv.reader(csvfile)
va = 0
for row in reader:
va+=1
if va == 1:
continue
print(row[2])
#dep = Departement(departement=row[2], description="Le departement du/de : "+row[2], id_code=row[1])
#dep.scave()
dep = Departement()
dep.departement = row[2]
dep.description = row[2]+"Je pense donc je suis"
dep.id_code = row[1]
Departement.save(dep)
# with open('scripts/depFakeDatas.csv', 'r+') as csvfile:
# reader = csv.reader(csvfile)
# va = 0
# for row in reader:
# va+=1
# if va == 1:
# continue
# print(row[2])
# #dep = Departement(departement=row[2], description="Le departement du/de : "+row[2], id_code=row[1])
# #dep.scave()
# dep = Departement()
# dep.departement = row[2]
# dep.description = row[2]+"Je pense donc je suis"
# dep.id_code = row[1]
# Departement.save(dep)
with open('scripts/comFakeDatas.csv', 'r+') as csvfile:
reader = csv.reader(csvfile)
va = 0
for com in reader:
va+=1
if va == 1:
continue
departe = Departement.objects.get(id_code = com[3])
commun = com[2]
descc = "Cogito ergo sum"
id_code = com[1]
print(departe,commun,descc,id_code)
laCom = Commune()
laCom.departement=departe
laCom.description=descc
laCom.id_code=id_code
laCom.commune=commun
laCom.save()
# with open('scripts/comFakeDatas.csv', 'r+') as csvfile:
# reader = csv.reader(csvfile)
# va = 0
# for com in reader:
# va+=1
# if va == 1:
# continue
# departe = Departement.objects.get(id_code = com[3])
# commun = com[2]
# descc = "Cogito ergo sum"
# id_code = com[1]
# print(departe,commun,descc,id_code)
# laCom = Commune()
# laCom.departement=departe
# laCom.description=descc
# laCom.id_code=id_code
# laCom.commune=commun
# laCom.save()
with open('scripts/sctComFakeDatas2.csv', 'r+') as csvfile:
reader = csv.reader(csvfile)
+4 -3
View File
@@ -27,7 +27,7 @@ class SmsGateway(AppBase):
tel = msg.peer.strip("+")
if tel not in valid_numbers:
# msg.respond('TEst')
msg.respond('Not in '+msg.peer)
# msg.respond('Not in '+msg.peer)
return True # Return false because we don't want to answer an unknow number
else: # If this number is in the list, will work with the text message
@@ -92,8 +92,9 @@ class SmsGateway(AppBase):
person = PersonneContact.objects.get(telephonePersonnel=tel)
station = StationObservers.objects.get(observer=person).station
id_station = StationObservers.objects.get(observer=person).station.id
formule = UniteDeMesure.objects.get(id = id_station).formule
id_station = station.id
formule = station.uniteMesure.formule
# formule = UniteDeMesure.objects.get(id = id_station).formule
val_float = float(msg.text) * float(formule)
+1 -1
View File
@@ -125,7 +125,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
'smslapli.context_processors.get_infos',
'smslapli.context_processors.app_list',
#'smslapli.context_processors.app_list',
)
MIDDLEWARE_CLASSES = (
+44 -2
View File
@@ -190,6 +190,48 @@
</ul>
</li>
{% endfor %}
{% else %}
<li><a><i class="fa fa-edit"></i>Structure de base<span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu" style="display: none">
<li><a href="/admin/base/departement/">Departements</a>
</li>
<li><a href="/admin/base/commune/">Communes</a>
</li>
<li><a href="/admin/base/sectioncommunale/">Section communales</a>
</li>
<li><a href="/admin/base/sitesentinelle/">Sites sentinnelles</a>
</li>
<li><a href="/admin/base/poste/">Postes</a>
</li>
<li><a href="/admin/base/personnecontact/">Personne contacts</a>
</li>
</ul>
</li>
<li><a><i class="fa fa-edit"></i>Collecte Pluviometrique<span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu" style="display: none">
<li><a href="/admin/hydromet/typestation/">Type station</a>
</li>
<li><a href="/admin/hydromet/station/">Station</a>
</li>
<li><a href="/admin/hydromet/observation/">Observation pluviometriques</a>
</li>
<li><a href="/admin/hydromet/stationobservers/">Observateurs</a>
</li>
<li><a href="/admin/hydromet/unitedemesure/">Unite de mesures</a>
</li>
<li><a href="/admin/hydromet/log/">Log</a>
</li>
</ul>
</li>
<li><a><i class="fa fa-edit"></i>Autorisation<span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu" style="display: none">
<li><a href="/admin/auth/group/">Groupes</a>
</li>
<li><a href="/admin/auth/user/">Utilisateurs</a>
</li>
</ul>
</li>
{% endif %}
</ul>
@@ -303,7 +345,7 @@
<p>Observation pluviometrique</p>
</div>
</div><!-- personNotSentMsg -->
<div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
<!-- <div class="animated flipInY col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="tile-stats">
<div class="icon"><canvas width="50" height="50" id="sleet"></canvas>
</div>
@@ -312,7 +354,7 @@
<h3>{% if "personNotSentMsg"|notification < '2' %}Agent n'a pas envoye{% else %} Agents n'ont pas envoyes{% endif %}</h3>
<p>Observation pluviometrique</p>
</div>
</div>
</div> -->
</div>
<div class="row">