why opts.pk here? Not saying this is incorrect, but I just don't see immediately why this is a correct replacement for the above. The old code above was copy-paste from old code in sql/query.py, and I never got to the point of actually understanding what it is doing.