Skip to content
Snippets Groups Projects
Commit 078b8be3 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

updated for ScoDoc9

parent 592a2a33
Branches
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ cnx = psycopg2.connect(DBCNXSTRING) ...@@ -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: ...@@ -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: ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment