[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] re: create_identity again

From: Karsten Hilbert
Subject: Re: [Gnumed-devel] re: create_identity again
Date: Thu, 20 Nov 2003 02:00:46 +0100
User-agent: Mutt/

> Ok , well this worked upto the return statement, but data is 1 and not a 
> list of tuples.
run_commit() now returns None, 1 or rows again.

None - error
1 - success, last SQL did not return rows
neither None nor 1 = rows = success, last SQL returned rows

> I remember that was why I
> used insert int v_basic_person instead, because it did work.
"because it did work" is not a valid reason to use it in a
place where it doesn't belong. Note, how create_dummy_identity
is called create_dummy_*identity* not create_dummy_*person*.
And it is named like that for a reason. It's the smallest
possible meaningful entity we can insert and not create too
much trouble in other parts of the schema.

>        cmd1 = "insert into identity(gender, dob) values('N/A', 
>        cmd2 = "select currval('identity_id_seq')"
this will return 1 row

>        data = gmPG.run_commit('personalia', [(cmd1, []), (cmd2, [])])
>        if data is None:
>                return None
>        print data
>        return data[0][0]
hence data should contain that row (or be None if any of cmd1
or cmd2 failed)

GPG key ID E4071346 @
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

reply via email to

[Prev in Thread] Current Thread [Next in Thread]