-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequete.py
52 lines (45 loc) · 1.3 KB
/
requete.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from ampalibe import Model
class Requete(Model):
def __init__(self, conf):
Model.__init__(self, conf)
@Model.verif_db
def get_membres(self):
req = """
SELECT id, nom, prenom, user_github_pic, fonction
FROM membre
"""
self.cursor.execute(req)
data = self.cursor.fetchall()
self.db.commit()
return data
@Model.verif_db
def get_descriptions_membres(self, id_membre):
req = """
SELECT description, prenom_usuel, facebook, linkedin, mail, tel1
FROM membre
WHERE id = %s
"""
self.cursor.execute(req, (id_membre,))
data = self.cursor.fetchone()
self.db.commit()
return data
@Model.verif_db
def get_projet(self):
req = """
SELECT nom, descriptions, couverture, lien
FROM projetsIteams
"""
self.cursor.execute(req)
data = self.cursor.fetchall()
self.db.commit()
return data
@Model.verif_db
def get_actualites(self):
req = """
SELECT titre, description, image, date
FROM actualites
"""
self.cursor.execute(req)
data = self.cursor.fetchall()
self.db.commit()
return data