Fixed primary key query for Django