Commit b8ef34b3 authored by Francois Mares's avatar Francois Mares
Browse files

Replace Client.py

parent 596e87cf
......@@ -3,18 +3,29 @@ from SQL import SQL
class Client(SQL):
def __init__(self):
super(self)
print("Nouveau client\n")
def consulter_horaire_train(self):
print("rien")
def rechercher_trajet(self, depart, arrivee):
self.requete_sql("INSERT INTO exemple VALUES('exemple')")
print("rien")
def __init__(self,HOST=None, DATABASE=None, PASSWORD=None, USER=None):
super().__init__(HOST, DATABASE, PASSWORD, USER)
def consulter_horaire_train(self,numero):
sql='''
SELECT depart, arrivee
FROM train INNER JOIN horaires
ON train.numero = horaires.id_train
WHERE train.numero=%d;
''' % numero
return self.requete_sql(sql)
# TO DO
def rechercher_trajet(self, ville_depart, ville_arrivee):
sql='''
SELECT numero
FROM (train INNER JOIN horaires
ON train.numero = horaires.id_train)
INNER JOIN arret
ON arret.gare = gare.id_gare
WHERE (gare.nom_ville='%s' OR gare.nom_ville='%s');
''' % (ville_depart,ville_arrivee)
return self.requete_sql(sql)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment