-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dj.Top restriction #1084
dj.Top restriction #1084
Conversation
…into top-restrcition
|
||
Similar to the univeral set operator, the top operator uses `dj.Top` notation. It is used to | ||
restrict a query by the given `limit`, `order_by`, and `offset` parameters: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Parameter | Keyword Arguments | Default Argument | Description |
| -- | -- | -- | -- |
| `limit` | | 1 | Restrict the number of rows returned. |
| `order_by` | "KEY", "DESC", "ASC" | "KEY" | |
| `offset` | | 0 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fill out the rest of the table. And perhaps the headings I am using (Keyword Arguments
, Default Argument
) are not the clearest, so feel free to replace.
Similar to the univeral set operator, the top operator uses `dj.Top` notation. It is used to | ||
restrict a query by the given `limit`, `order_by`, and `offset` parameters: | ||
|
||
```python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```python | |
Examples | |
```python |
The result of this expression returns the first 10 rows of `Session` and sorts them | ||
by their `session_date` in ascending order. | ||
|
||
### `order_by` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### `order_by` |
The default values for `dj.Top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default values for `dj.Top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`. |
This PR needs to:
Continuing work on this at #1178. |
dj.Top continued (#1084)
No description provided.