MCPcopy
hub / github.com/ormar-orm/ormar / offset

Method offset

ormar/queryset/queryset.py:979–996  ·  view source on GitHub ↗

You can also offset the results by desired number of main models. To offset the actual number of database query rows instead of number of main models use the `limit_raw_sql` parameter flag, and set it to `True`. :param limit_raw_sql: flag if raw sql should be offse

(
        self, offset: int, limit_raw_sql: Optional[bool] = None
    )

Source from the content-addressed store, hash-verified

977 return self.rebuild_self(limit_count=limit_count, limit_raw_sql=limit_raw_sql)
978
979 def offset(
980 self, offset: int, limit_raw_sql: Optional[bool] = None
981 ) -> "QuerySet[T]":
982 """
983 You can also offset the results by desired number of main models.
984
985 To offset the actual number of database query rows instead of number of main
986 models use the `limit_raw_sql` parameter flag, and set it to `True`.
987
988 :param limit_raw_sql: flag if raw sql should be offset
989 :type limit_raw_sql: bool
990 :param offset: numbers of models to offset
991 :type offset: int
992 :return: QuerySet
993 :rtype: QuerySet
994 """
995 limit_raw_sql = self.limit_sql_raw if limit_raw_sql is None else limit_raw_sql
996 return self.rebuild_self(offset=offset, limit_raw_sql=limit_raw_sql)
997
998 def _single_row_order_bys(self, reverse: bool) -> list["OrderAction"]:
999 """

Callers 11

test_or_filtersFunction · 0.45
test_gettingFunction · 0.45
test_queryset_methodsFunction · 0.45
test_offsetFunction · 0.45
test_selecting_relatedFunction · 0.45
test_selecting_relatedFunction · 0.45
test_selecting_relatedFunction · 0.45
test_limit_and_offsetFunction · 0.45
paginationFunction · 0.45
applyMethod · 0.45

Calls 1

rebuild_selfMethod · 0.95

Tested by 9

test_or_filtersFunction · 0.36
test_gettingFunction · 0.36
test_queryset_methodsFunction · 0.36
test_offsetFunction · 0.36
test_selecting_relatedFunction · 0.36
test_selecting_relatedFunction · 0.36
test_selecting_relatedFunction · 0.36
test_limit_and_offsetFunction · 0.36