Skip to content
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

fix: the error in obtaining the document list #2406

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

shaohuzhang1
Copy link
Contributor

fix: the error in obtaining the document list

@shaohuzhang1 shaohuzhang1 merged commit c6c3799 into main Feb 26, 2025
4 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@main@fix_document_page branch February 26, 2025 02:26
return {
'document_custom_sql': query_set,
'order_by_query': order_by_query_set
}

def list(self, with_valid=False):
if with_valid:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is mostly clean, but there are some minor improvements that can be made:

  1. In the get_query_set method, you may want to ensure that the dynamic model retrieved by get_dynamics_model has all the fields specified ('char_length', 'paragraph_count', "update_time", 'create_time') defined and accessible.

  2. 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
  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant