[whos/annuaires_pg] affichage commentaire prise
Ignore-this: 5f139b5ce479c654d6ed64dcae6892d2 darcs-hash:20121116234433-28565-b2becfb73c07a025b7b77e465c6792b2b4524a68.gz
This commit is contained in:
parent
9022007377
commit
6089aa2d38
2 changed files with 18 additions and 0 deletions
|
@ -44,6 +44,17 @@ def chbre_prises(batiment, chambre = None):
|
|||
raise ValueError("Batiment inexistant")
|
||||
return ret
|
||||
|
||||
def chbre_commentaire(batiment, chambre):
|
||||
""" Renvoie le commentaire associé à la chambre """
|
||||
global conn
|
||||
batiment = batiment.lower()
|
||||
cur = conn.cursor()
|
||||
cur.execute("SELECT commentaire FROM prises WHERE (batiment, chambre) = (%s,%s)", (batiment, chambre))
|
||||
try:
|
||||
return cur.fetchone()[0]
|
||||
except TypeError:
|
||||
raise ValueError("Chambre inexistante")
|
||||
|
||||
def reverse(batiment, prise = None):
|
||||
"""Correspondance prise -> chambre"""
|
||||
batiment = batiment.lower()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue