You can limit the results to desired number of parent models. To limit 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 limited
(
self, limit_count: int, limit_raw_sql: Optional[bool] = None
)
| 958 | return self.rebuild_self(limit_count=limit_count, offset=query_offset) |
| 959 | |
| 960 | def limit( |
| 961 | self, limit_count: int, limit_raw_sql: Optional[bool] = None |
| 962 | ) -> "QuerySet[T]": |
| 963 | """ |
| 964 | You can limit the results to desired number of parent models. |
| 965 | |
| 966 | To limit the actual number of database query rows instead of number of main |
| 967 | models use the `limit_raw_sql` parameter flag, and set it to `True`. |
| 968 | |
| 969 | :param limit_raw_sql: flag if raw sql should be limited |
| 970 | :type limit_raw_sql: bool |
| 971 | :param limit_count: number of models to limit |
| 972 | :type limit_count: int |
| 973 | :return: QuerySet |
| 974 | :rtype: QuerySet |
| 975 | """ |
| 976 | limit_raw_sql = self.limit_sql_raw if limit_raw_sql is None else limit_raw_sql |
| 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 |