Query is breking for no clear reason

14 views
Skip to first unread message

Marcelo Juan Saciloto

unread,
Sep 7, 2018, 10:36:00 AM9/7/18
to Django users

HELLO, good morning!

 

I am not very familiarised with python, but I have been reading some documentations, so have been struggling with one problem, I hope  someone is able to help me.

 

So I have created a queryset to insert the locale clause in all queries in 3 different models of my application and I had to inherit my query set, this models also extend other querysets


The queries is working fine, I have unit test they are woking as expected, except for one case where I have the follow exception:


Screen Shot 2018-09-07 at 10.34.34.png



I debug the query that is executed for this method and it looks all right:

 

Screen Shot 2018-09-07 at 10.41.22.png


 

It seems correct I had a doubt if it is necessary to insert single quotes in the en-us, so I tried to use in my code locale with “ ‘ en-us ’ ”, I saw that the first quotes are skipped so when I check the query it was not returning syntax error, but it makes the query do not filter the results the way it is expected. Then I revert it.

 

Anyone has seen the same issue ?


Best regards,

Marcelo Saciloto

Reply all
Reply to author
Forward
0 new messages