fix: the error in obtaining the document list#2406
Merged
shaohuzhang1 merged 1 commit intomainfrom Feb 26, 2025
Merged
Conversation
shaohuzhang1
commented
Feb 26, 2025
| } | ||
|
|
||
| def list(self, with_valid=False): | ||
| if with_valid: |
Contributor
Author
There was a problem hiding this comment.
The code is mostly clean, but there are some minor improvements that can be made:
-
In the
get_query_setmethod, you may want to ensure that the dynamic model retrieved byget_dynamics_modelhas all the fields specified ('char_length','paragraph_count',"update_time",'create_time') defined and accessible. -
When returning the results, instead of using a dictionary with keys
'document_custom_sql'and'order_by_query', it might make more sense to directly define these variables within the function scope for clarity:
def get_query_set(self):
# existing logic...
return query_set, order_by_query_set- If possible, consider moving away from using hardcoded field names like
'status'. You could set them up dynamically based on configuration settings so they're easier to change later without modifying many places in your codebase.
These changes won't significantly impact functionality but will improve readability and maintainability slightly.
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.
fix: the error in obtaining the document list