Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now available in preview.


Allow entity comparisons using provided orderings.

Inherits From: expected_type

The iterator passed to the constructor is eventually consumed via calls to GetNext(), which generate new SortOrderEntity s with the same orderings.

entity_iterator an iterator of entities which will be wrapped.
orderings an iterable of (identifier, order) pairs. order should be either Query.ASCENDING or Query.DESCENDING.



View source

Compare two entities and return their relative order.

Compares self to that based on the current sort orderings and the key orders between them. Returns negative, 0, or positive depending on whether self is less, equal to, or greater than that. This comparison returns as if all values were to be placed in ascending order (highest value last). Only uses the sort orderings to compare (ignores keys).

that SortOrderEntity

Negative if self < that Zero if self == that Positive if self > that


View source

Gets the wrapped entity.


View source

Wrap and return the next entity.

The entity is retrieved from the iterator given at construction time.


View source

Return self==value.


View source

Return self>=value.


View source

Return self>value.


View source

Return self<=value.


View source

Return self<value.


View source

Return self!=value.