[annuaires_pg] Normalisation de batiment et chambre

darcs-hash:20100831071401-ffbb2-61f859c443ca4385717886282c2cd4637846061c.gz
This commit is contained in:
Nicolas Dandrimont 2010-08-31 09:14:01 +02:00
parent 40e59dee85
commit fdc03af8f5

View file

@ -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()