@@ -221,25 +221,26 @@ The examples below will use the table definitions in [table tiers](../reproduce/
221
221
222
222
## Top
223
223
224
- Similar to the univeral set operator, the top operator uses ` dj.top ` notation. It is used to
224
+ Similar to the univeral set operator, the top operator uses ` dj.Top ` notation. It is used to
225
225
restrict a query by the given ` limit ` , ` order_by ` , and ` offset ` parameters:
226
226
227
227
``` python
228
- Session & dj.top (limit = 10 , order_by = ' session_date' )
228
+ Session & dj.Top (limit = 10 , order_by = ' session_date' )
229
229
```
230
230
231
231
The result of this expression returns the first 10 rows of ` Session ` and sorts them
232
232
by their ` session_date ` in ascending order.
233
233
234
234
### ` order_by `
235
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 ` |
236
+ | Example | Description |
237
+ | -------------------------------------------| ---------------------------------------------------------------------------------|
238
+ | ` order_by="session_date DESC" ` | Sort by ` session_date ` in * descending* order |
239
+ | ` order_by="KEY" ` | Sort by the primary key |
240
+ | ` order_by="KEY DESC" ` | Sort by the primary key in descending order |
241
+ | ` order_by=["subject_id", "session_date"] ` | Sort by ` subject_id ` , then sort matching ` subject_id ` s by their ` session_date ` |
241
242
242
- The default values for ` dj.top ` parameters are ` limit=1 ` , ` order_by="KEY" ` , and ` offset=0 ` .
243
+ The default values for ` dj.Top ` parameters are ` limit=1 ` , ` order_by="KEY" ` , and ` offset=0 ` .
243
244
244
245
## Restriction
245
246
0 commit comments