Closed
Conversation
A-Baji
commented
May 17, 2023
…into top-restrcition
Collaborator
Author
kabilar
reviewed
Jun 23, 2023
kabilar
reviewed
Jun 23, 2023
|
|
||
| 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: | ||
|
|
Contributor
There was a problem hiding this comment.
| Parameter | Keyword Arguments | Default Argument | Description |
| -- | -- | -- | -- |
| `limit` | | 1 | Restrict the number of rows returned. |
| `order_by` | "KEY", "DESC", "ASC" | "KEY" | |
| `offset` | | 0 | |
Contributor
There was a problem hiding this comment.
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.
kabilar
reviewed
Jun 23, 2023
| 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 |
Contributor
There was a problem hiding this comment.
Suggested change
| ```python | |
| Examples | |
| ```python |
kabilar
reviewed
Jun 23, 2023
| The result of this expression returns the first 10 rows of `Session` and sorts them | ||
| by their `session_date` in ascending order. | ||
|
|
||
| ### `order_by` |
Contributor
There was a problem hiding this comment.
Suggested change
| ### `order_by` |
kabilar
reviewed
Jun 23, 2023
Comment on lines
+243
to
+244
| The default values for `dj.Top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`. | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| The default values for `dj.Top` parameters are `limit=1`, `order_by="KEY"`, and `offset=0`. |
Contributor
|
This PR needs to:
Continuing work on this at #1178. |
ethho
added a commit
that referenced
this pull request
Sep 12, 2024
dimitri-yatsenko
added a commit
that referenced
this pull request
Sep 12, 2024
dj.Top continued (#1084)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.