diff options
| author | P. Christeas <p_christ@hol.gr> | 2009-05-01 23:48:18 +0300 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2009-05-01 23:48:18 +0300 |
| commit | c25b122b3c2803d75ac95a947f3419cc8fc87968 (patch) | |
| tree | 216e4c1bf5abc427990d70159a07cc01f2fe8537 /bin/workflow/instance.py | |
| parent | 7cf2c6b01c6ff75ecc6a1e5549ad5540a0148a4c (diff) | |
Workflow: optimize out one SQL command.
bzr revid: p_christ@hol.gr-20090501204818-fzmdw4w09bcukr4n
Diffstat (limited to 'bin/workflow/instance.py')
| -rw-r--r-- | bin/workflow/instance.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/workflow/instance.py b/bin/workflow/instance.py index b78b5ae7dbe..99e041ab860 100644 --- a/bin/workflow/instance.py +++ b/bin/workflow/instance.py @@ -28,9 +28,8 @@ import pooler def create(cr, ident, wkf_id): (uid,res_type,res_id) = ident - cr.execute("select nextval('wkf_instance_id_seq')") + cr.execute('insert into wkf_instance (res_type,res_id,uid,wkf_id) values (%s,%s,%s,%s) RETURNING id', (res_type,res_id,uid,wkf_id)) id_new = cr.fetchone()[0] - cr.execute('insert into wkf_instance (id,res_type,res_id,uid,wkf_id) values (%s,%s,%s,%s,%s)', (id_new,res_type,res_id,uid,wkf_id)) cr.execute('select * from wkf_activity where flow_start=True and wkf_id=%s', (wkf_id,)) res = cr.dictfetchall() stack = [] |
