UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class ‘myapp.models.Power’> QuerySet.
paginator = self.django_paginator_class(queryset, page_size)
The reason is that you are not sorting.
Solution.
(a) add ordering to the design of the model
class test(models.Model):
...
class Meta:
...
ordering=["xx"]
(b) Add order_by to the query set for sorting
Read More:
- Solution of Hibernate paging report only entering result set and not supporting requested operation
- [Solved] Mybatis uses the PageHelper paging plugin error: Could not find method on interface ibatis.executor.Executor named query.
- [Solved] Tensorflow2.0 Error: Function call stack:distributed_function
- React Hook “useState“ is called in function “xxx“ which is neither a React function component or
- [Solved] Error: error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
- [How to Fix]Type error: must use keyword argument for key function
- Type error: must use keyword argument for key function
- QT solves error: use of deleted function and is private within this context
- TypeError: res.render is not a function
- C++ Use of deleted function error
- [Solved] Vue Error: Failed to mount component: template or render function not defined
- [Solved] MindSpore Network custom reverse error: TypeError: The params of function ‘bprop’ of
- Solve the data transfer between vue irrelevant components error: this.$store.commit is not a function
- MOTR compiling error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_R
- [How to Fix] _this2.$xxxis not a function
- TypeError: db.collection is not a function
- error: field ‘XXX’ declared as a function [How to Solve]
- [Solved] Vue Install less Error: this.getOptions is not a function
- this.$el.querySelectorAll is not a function [How to Solve]
- Numpy.exp Function Error ‘Float’ object has no attribute ‘exp’