Skip to content

Commit f303549

Browse files
committed
more docs
1 parent 5bb8da4 commit f303549

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/src/query/operators.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,15 @@ Session & dj.top(limit=10, order_by='session_date')
229229
```
230230

231231
The result of this expression returns the first 10 rows of `Session` and sorts them
232-
by their `session_date` in ascending order. If the `order_by` argument was instead: `session_date DESC`, then it would be sorted in descending order.
232+
by their `session_date` in ascending order.
233+
234+
### `order_by`
235+
236+
| Example | Description |
237+
|-------------------------------------------|-----------------------------------------------------------------------------------|
238+
| `order_by="session_date DESC"` | Sorts by `session_date` in *descending* order |
239+
| `order_by="KEY"` | Sorts by the primary key(s) |
240+
| `order_by=["subject_id", "session_date"]` | Sorts by `subject_id`, then sorts matching `subject_id`s by their `session_date` |
233241

234242
The default values for `dj.top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`.
235243

0 commit comments

Comments
 (0)