forked from ScoDoc/ScoDoc
updated for ScoDoc9
This commit is contained in:
parent
592a2a33c5
commit
078b8be33d
@ -35,7 +35,7 @@ cnx = psycopg2.connect(DBCNXSTRING)
|
|||||||
cursor = cnx.cursor()
|
cursor = cnx.cursor()
|
||||||
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"select count(*) from notes_formsemestre where formsemestre_id=%(formsemestre_id)s",
|
"select count(*) from notes_formsemestre where id=%(formsemestre_id)s",
|
||||||
{"formsemestre_id": formsemestre_id},
|
{"formsemestre_id": formsemestre_id},
|
||||||
)
|
)
|
||||||
nsem = cursor.fetchone()[0]
|
nsem = cursor.fetchone()[0]
|
||||||
@ -44,9 +44,9 @@ if nsem != 1:
|
|||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"""select i.etudid
|
"""select i.id
|
||||||
from identite i, notes_formsemestre_inscription ins
|
from identite i, notes_formsemestre_inscription ins
|
||||||
where i.etudid=ins.etudid and ins.formsemestre_id=%(formsemestre_id)s
|
where i.id=ins.etudid and ins.formsemestre_id=%(formsemestre_id)s
|
||||||
""",
|
""",
|
||||||
{"formsemestre_id": formsemestre_id},
|
{"formsemestre_id": formsemestre_id},
|
||||||
)
|
)
|
||||||
@ -64,7 +64,7 @@ for (etudid,) in cursor:
|
|||||||
"etudid": etudid,
|
"etudid": etudid,
|
||||||
"code_nip": random.randrange(10000000, 99999999),
|
"code_nip": random.randrange(10000000, 99999999),
|
||||||
}
|
}
|
||||||
req = "update identite set nom=%(nom)s, prenom=%(prenom)s, civilite=%(civilite)s where etudid=%(etudid)s"
|
req = "update identite set nom=%(nom)s, prenom=%(prenom)s, civilite=%(civilite)s where id=%(etudid)s"
|
||||||
# print( req % args)
|
# print( req % args)
|
||||||
wcursor.execute(req, args)
|
wcursor.execute(req, args)
|
||||||
n += 1
|
n += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user