Something More Elegant
iurisilvio at gmail.com
Sat Jan 9 14:30:17 CET 2010
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 <victorsubervi at gmail.com>wrote:
> 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)
> tmp = [itm for itm in cursor]
> packageIDs = 
> for t in tmp:
> if t not in packageIDs:
> The Logos has come to bear
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list