Re: MySQLdb and column names

2008-01-30 Thread beef
change:
I would prefer to have the key names consistent, so that event the

to:
I would prefer to have the key names consistent, so that *even* the
-- 
http://mail.python.org/mailman/listinfo/python-list


MySQLdb and column names

2008-01-30 Thread beef
Hello all,

I am using MySQLdb 1.2.2 and have a question about the construction of
the dictionary keys of a result set.

Here is an example query, from which you may intuit some of the
structure of the tables:

SELECT
  shots.*,
  users.*,
  sequences.*,
  jobs.*
FROM
  shots
LEFT JOIN
  users ON  users.id=shots.user_id
INNER JOIN
sequences ON sequences.id=shots.sequence_id
INNER JOIN
jobs AS j ON j.id=sequences.job_id
WHERE
shots.id=%s

1. The 'users' table has a column named 'id', as do all the other
tables.
2. I define my cursor as a 'DictCursor' so that my results are
dictionaries
3. The 'shots' id has the key name of 'id', while all the -other-
'id's have key names of the form: ".id"

I would prefer to have the key names consistent, so that event the
"shots" fields have key names of the form  ".id"

Is this possible?

Thanks in advance!

--
Wellington

-- 
http://mail.python.org/mailman/listinfo/python-list