My fix for django 1.4

I'm fix work with query set and some imports.