In reference to this for mysql ,I tried the following in my Django code
myQuery.order_by('myColumn+0')
myQuery.order_by('myColumn'+0)
but none worked for me
In reference to this for mysql ,I tried the following in my Django code
myQuery.order_by('myColumn+0')
myQuery.order_by('myColumn'+0)
but none worked for me
Well found the solution thanks to ppeterka 66
myQuery.filter().extra(
select={'myinteger': 'CAST(mycharfield AS UNSIGNED)'}
).order_by('myinteger')
I used UNSIGNED instead of INTEGER, I guess my mysql doesnot support it