Compatibility with query results without pk field

BaseQuery.paginate() method works now.