On Jun 22, 12:12 pm, Christoph Haas <[EMAIL PROTECTED]> wrote:
> 2007-06-22 18:09:57,852 INFO sqlalchemy.engine.base.Engine.0x..6c SELECT 
> records_a.id, records_a.domain_id, records_a.dhcpzone_id, records_a.name, 
> records_a.type, records_a.content, records_a.ttl, records_a.prio, 
> records_a.change_date, records_a.mac_address, records_a.inet
> FROM records AS records_a LEFT OUTER JOIN records AS records_ptr ON 
> records_a.inet = records_ptr.inet AND records_ptr.type = %(records_ptr_type)s
> WHERE records_a.type = %(records_a_type)s
> 2007-06-22 18:09:57,852 INFO sqlalchemy.engine.base.Engine.0x..6c 
> {'records_a_type': 'A', 'records_ptr_type': 'PTR'}
>
> In [5]: result.keys()
> Out[5]:
> ['id',
>  'domain_id',
>  'dhcpzone_id',
>  'name',
>  'type',
>  'content',
>  'ttl',
>  'prio',
>  'change_date',
>  'mac_address',
>  'inet']
>
> As you see the keys are just there once. Although the actual SQL result
> contains these columns for both records_a and the joined records_ptr.

set use_labels=True in your select() statement.  the point of that is
to combine table or alias names with column names as labels for all
selected columns, so that names are automatically unique.  the column-
targeting i mentioned also would rely upon this to differentiate
between the two tables.

this is also the most common criticism of the SQL language in general;
that its legal to have the same name specified twice in the list of
attributes.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to