You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I try to get other than the first object from DB, my object fields are shifted by one, and the last one is completely discarded. For example if I have this model:
and then if I try to fetch an object with this code
Person.objects.all()[1]
my object going to have these values assigned:
uuid = 2L
title = uuid
first_name = title
last_name = first_name
and the last_name value is discarded completely. I tracked down the issue to the generated query:
sql ="SELECT {row_num_col}, {outer} FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY {order}) as {row_num_col}, {inner}) as QQQ where {where}"
and the cause is the selection of {row_num_col} column, which is not needed for the output. It works fine for the first object, because different query is issued. I'm using django==1.8, but I don't think it matters, there is simply no reason to select that field for the output.
The text was updated successfully, but these errors were encountered:
Whenever I try to get other than the first object from DB, my object fields are shifted by one, and the last one is completely discarded. For example if I have this model:
and then if I try to fetch an object with this code
my object going to have these values assigned:
and the last_name value is discarded completely. I tracked down the issue to the generated query:
and the cause is the selection of
{row_num_col}
column, which is not needed for the output. It works fine for the first object, because different query is issued. I'm using django==1.8, but I don't think it matters, there is simply no reason toselect
that field for the output.The text was updated successfully, but these errors were encountered: