fix empty queryset support for django 1.6