{"action":"closed","issue":{"url":"https://api.github.com/repos/coleifer/peewee/issues/1163","repository_url":"https://api.github.com/repos/coleifer/peewee","labels_url":"https://api.github.com/repos/coleifer/peewee/issues/1163/labels{/name}","comments_url":"https://api.github.com/repos/coleifer/peewee/issues/1163/comments","events_url":"https://api.github.com/repos/coleifer/peewee/issues/1163/events","html_url":"https://github.com/coleifer/peewee/issues/1163","id":199014459,"number":1163,"title":"Dicts not resolving join column name conflicts properly","user":{"login":"jontonsoup","id":845636,"avatar_url":"https://avatars.githubusercontent.com/u/845636?v=3","gravatar_id":"","url":"https://api.github.com/users/jontonsoup","html_url":"https://github.com/jontonsoup","followers_url":"https://api.github.com/users/jontonsoup/followers","following_url":"https://api.github.com/users/jontonsoup/following{/other_user}","gists_url":"https://api.github.com/users/jontonsoup/gists{/gist_id}","starred_url":"https://api.github.com/users/jontonsoup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jontonsoup/subscriptions","organizations_url":"https://api.github.com/users/jontonsoup/orgs","repos_url":"https://api.github.com/users/jontonsoup/repos","events_url":"https://api.github.com/users/jontonsoup/events{/privacy}","received_events_url":"https://api.github.com/users/jontonsoup/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-05T17:36:05Z","updated_at":"2017-01-09T21:25:17Z","closed_at":"2017-01-09T21:25:17Z","body":"Say I want to join three tables and two of the tables have the same column. \r\n```\r\nclass Order(Model):\r\n     status = Text....\r\nclass Betcycle(Model):\r\n      status = Text....\r\n```\r\n```\r\n rt_orders = list(Order.select(Order, RtPick, Betcycle).join(\r\n     RtPick).join(Betcycle).where(Order.status == \"SETTLED\").dicts())\r\n df_rt_orders = pd.DataFrame(rt_orders)  ##use dict \r\n```\r\n\r\nThe generated SQL will be correct (and will correctly call from the right table), but the retuning dict will only pick one of the `status` columns instead of alias them properly by table. \r\n\r\nI can do this: \r\n\r\n```\r\nOrder.select(Order, Order.status.alias(\"order_status\"), RtPick, Betcycle.status.alias(\"betcycle_status\")).....\r\n```\r\n\r\nbut it seems like this can, and should be something that is automatically resolved. \r\n\r\nI can try to submit a pull request if you agree this is a problem\r\n"}}
{"actor":{"display_login":"coleifer"}}