2015-12-19 14:52:17 +01:00
|
|
|
title: limit
|
|
|
|
---
|
|
|
|
summary: Limits the total number of items returned.
|
|
|
|
---
|
|
|
|
type: method
|
|
|
|
---
|
|
|
|
signature: offset
|
|
|
|
---
|
|
|
|
body:
|
|
|
|
|
|
|
|
The offset method can be used to limit the return value to a certain number
|
|
|
|
of matching records.
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```html+jinja
|
|
|
|
<h3>Our Top 3</h3>
|
|
|
|
<ul>
|
|
|
|
{% for item in this.children.order_by('-rating').limit(3) %}
|
2016-07-22 17:47:09 +02:00
|
|
|
<li>{{ item.title }}</li>
|
2015-12-19 14:52:17 +01:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
```
|