A complex query is one that hits several tables in several databases on more than one server.<p>You can simply forget that using django, you'll have to export all the stuff you want to query in a format that <i>exactly</i> matches Djangos field name magic.<p>And better not get any of that wrong or you'll be tearing your hair out, an underscore in the wrong spot and it will <i>look</i> just fine but it will never work and the error messages you'll get are much less than helpful.<p>Here is a comment from the models.py file in one of my little django applications:<p><pre><code>    # caveat, the related_name parameters of parent and thread
    # should not be parent_id or thread_id, this leads to
    # an 'add() argument after * must be a sequence' error
    # when transforming the template. Apparently the names
    # clash with the underlying field names that django 
    # uses for these fields.
</code></pre>
So, effectively, what this is all about is that django names a bunch of fields in the queries as aliases, but does not check if there are real fields with those names.