Re: Complex query, queryset.query.alias_map and query changes

2016-09-23 Thread Felipe Prenholato
Yeah, I know :\, but still maybe someone have a good idea :), lot of people still using old Django versions. I tried the expressions, the `F()` but it not worked well and I had no time to debug why, but in next weeks I'll probably create a slug field to compare directly. I post here if have updat

Re: Complex query, queryset.query.alias_map and query changes

2016-09-23 Thread Tim Graham
Not sure, this is using lots of private API and QuerySet.extra() which is discourage these days. I'm afraid you won't get much help for unsupported Django versions. After you upgrade to Django 1.9+, hopefully you can construct your query using the new expressions API! https://docs.djangoprojec

Complex query, queryset.query.alias_map and query changes

2016-09-23 Thread Felipe Prenholato
Hello folks! I have a complex queryset here that do joins in at least 8 tables. The query is fast, but has use of Postgresql `concat` method, and to make it have correct aliases I'm using `qs.query.alias_map` where qs is my queryset instance: def my_complex_queryset(self): qs = self.filter(*l