Since pickle compatibility errors can be difficult to diagnose, such as silently corrupted objects, a exists so that specialized query subclasses can reconstruct internal query state.
The value of the parameter is an opaque representation of that query state and is not part of a public API.
However, it is safe (and fully supported) to pickle and unpickle the attribute’s contents as described here.
are only valid for the version of Django that was used to generate them.
A particular ordering is guaranteed only when ordering by a set of fields that uniquely identify each object in the results.
For example, if a Note that this is not quite the same as slicing from the end of a sequence in Python.
If you generate a pickle using Django version N, there is no guarantee that pickle will be readable with Django version N 1.
Pickles should not be used as part of a long-term archival strategy.
Each foreign key you add will implicitly include all of its default orderings as well.
If a query doesn’t have an ordering specified, results are returned from the database in an unspecified order.
You can order by a field converted to lowercase with Warning Ordering is not a free operation.