[annuaires_pg] Normalisation de batiment et chambre
darcs-hash:20100831071401-ffbb2-61f859c443ca4385717886282c2cd4637846061c.gz
This commit is contained in:
parent
40e59dee85
commit
fdc03af8f5
1 changed files with 4 additions and 0 deletions
|
@ -58,12 +58,16 @@ def reverse(batiment, prise = None):
|
|||
|
||||
def is_crans(batiment, chambre):
|
||||
"""Chambre cablee au Cr@ns ?"""
|
||||
batiment = batiment.lower()
|
||||
chambre = chambre.lower()
|
||||
cur = conn.cursor()
|
||||
cur.execute("SELECT crans FROM prises WHERE (batiment, chambre) = (%s, %s)", (batiment, chambre))
|
||||
return cur.fetchone()[0]
|
||||
|
||||
def crous_to_crans(batiment, chambre):
|
||||
"""Passage d'une chambre de CROUS a Cr@ns"""
|
||||
batiment = batiment.lower()
|
||||
chambre = chambre.lower()
|
||||
if is_crans(batiment, chambre):
|
||||
return
|
||||
cur = conn.cursor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue