Re: Something More Elegant

2010-01-20 Thread Victor Subervi
On Sun, Jan 17, 2010 at 5:36 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: I don't think that would be efficient, considering that the above entails what would be something like three or four courses all by themselves (Database Analysis, Database Design, SQL [these three are

Re: Something More Elegant

2010-01-17 Thread Victor Subervi
On Sat, Jan 9, 2010 at 1:00 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: After the table design is complete you can move to business logic operations (SQL for standard/fixed actions), along with criteria to maintain the integrity of the data (foreign key constraints, etc.). This

Re: Something More Elegant

2010-01-10 Thread Victor Subervi
On Sat, Jan 9, 2010 at 3:00 PM, Stephen Hansen apt.shan...@gmail.comwrote: On Sat, Jan 9, 2010 at 7:15 AM, Victor Subervi victorsube...@gmail.comwrote: On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden st...@holdenweb.com wrote: But we are now in the realm of theory as far as you are concerned,

Something More Elegant

2010-01-09 Thread Victor Subervi
Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where c.CategoryID=%s;' % (store, store, categoryID) cursor.execute(sql) tmp = [itm[0] for itm in cursor]

Re: Something More Elegant

2010-01-09 Thread Iuri
Your code select some ids from database and list distinct ids in packageIDs. You can use SELECT DISTINCT in your SQL statement. On Sat, Jan 9, 2010 at 11:23 AM, Victor Subervi victorsube...@gmail.comwrote: Hi; The following code works fine. I would like you to suggest something more simple

Re: Something More Elegant

2010-01-09 Thread Tim Chase
Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where c.CategoryID=%s;' % (store, store, categoryID) cursor.execute(sql) tmp = [itm[0] for

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase python.l...@tim.thechases.comwrote: Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and elegant: sql = 'select p.ID from %sPackages p join %sCategoriesPackages c where

Re: Something More Elegant

2010-01-09 Thread Steve Holden
Victor Subervi wrote: On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase python.l...@tim.thechases.com mailto:python.l...@tim.thechases.com wrote: Victor Subervi wrote: Hi; The following code works fine. I would like you to suggest something more simple and

Re: Something More Elegant

2010-01-09 Thread Gabriel Genellina
En Sat, 09 Jan 2010 11:01:25 -0300, Victor Subervi victorsube...@gmail.com escribió: On Sat, Jan 9, 2010 at 8:39 AM, Tim Chase python.l...@tim.thechases.comwrote: It would also help if you didn't pass the categoryID as a string-formatted value, but as a proper parameter, something like

Re: Something More Elegant

2010-01-09 Thread Iuri
And you should use cursor.fetchall() instead of cursor in list comprehension: packageIDs = [itm[0] for itm in cursor.fetchall()] On Sat, Jan 9, 2010 at 1:01 PM, Gabriel Genellina gagsl-...@yahoo.com.arwrote: En Sat, 09 Jan 2010 11:01:25 -0300, Victor Subervi victorsube...@gmail.com escribió:

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden st...@holdenweb.com wrote: But we are now in the realm of theory as far as you are concerned, since you have already stated several times that you aren't interested in correcting your design until after you have got the current mess into

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 10:14 AM, Iuri iurisil...@gmail.com wrote: And you should use cursor.fetchall() instead of cursor in list comprehension: packageIDs = [itm[0] for itm in cursor.fetchall()] Now, someone else on this list told me the other. Can you explain the difference? TIA, beno --

Re: Something More Elegant

2010-01-09 Thread Victor Subervi
On Sat, Jan 9, 2010 at 1:00 PM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: On Sat, 9 Jan 2010 10:28:31 -0500, Victor Subervi victorsube...@gmail.com declaimed the following in gmane.comp.python.general: On Sat, Jan 9, 2010 at 10:14 AM, Iuri iurisil...@gmail.com wrote: And you should

Re: Something More Elegant

2010-01-09 Thread Stephen Hansen
On Sat, Jan 9, 2010 at 7:15 AM, Victor Subervi victorsube...@gmail.comwrote: On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden st...@holdenweb.com wrote: But we are now in the realm of theory as far as you are concerned, since you have already stated several times that you aren't interested in