Dicts not resolving join column name conflicts properly
How would it be automatically resolved? What would happen? How would Peewee pick one?

The answer you've come up with -- specifying an alias -- is the right approach. I'm not sure why you couldn't automatically prepend the name of the model infront of the column name and return both in cases where there is a clash.

I've seen this in other ORMs I've used. The current behavior is dangerous because you don't know which column you are getting back and there are no warnings emitted. It fails silently. 

What do you think? 

On Mon, Jan 09, 2017 at 4:25 PM Charles Leifer

<
mailto:Charles Leifer <notifications@github.com>
> wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

Closed
https://github.com/coleifer/peewee/issues/1163
.

—

You are receiving this because you authored the thread.

Reply to this email directly,
https://github.com/coleifer/peewee/issues/1163#event-916600137
, or
https://github.com/notifications/unsubscribe-auth/AAznRLh5vOf5cpz7cudDbBGElQciGeUEks5rQqXAgaJpZM4Lb76I
.
Say I want to join three tables and two of the tables have the same column. 
```
class Order(Model):
     status = Text....
class Betcycle(Model):
      status = Text....
```
```
 rt_orders = list(Order.select(Order, RtPick, Betcycle).join(
     RtPick).join(Betcycle).where(Order.status == "SETTLED").dicts())
 df_rt_orders = pd.DataFrame(rt_orders)  ##use dict 
```

The 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. 

I can do this: 

```
Order.select(Order, Order.status.alias("order_status"), RtPick, Betcycle.status.alias("betcycle_status")).....
```

but it seems like this can, and should be something that is automatically resolved. 

I can try to submit a pull request if you agree this is a problem
