Before merging of queryset-refactor it was possible to join any table with any ON clause to any queryset with help of Q.as_sql. For example, please see this one: http://www.djangosnippets.org/snippets/257/
Since Django 1.0 ORM looks like more complicated, Q.as_sql is disappeared (but still mentioned in docs (http:// docs.djangoproject.com/en/dev/ref/models/fields/). As I see from code Q.as_sql was replaced with Q.add_to_query(self, query, used_aliases) but from current code it looks like new implementation does not allow to use ON clause with more than 1 statements, for example: FROM blog LEFT JOIN cron_stats AS stats ON stats.content_type_id = 12 AND stats.object_id = blog.id Is it any way to use old behavior of Q.as_sql with Django 1.0 and join any table that I want to any queryset? In other words, is it possible to make working QLeftOuterJoin from http://www.djangosnippets.org/snippets/257/? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---