(self, with_valid=False)
| 764 | return FileSerializer.Operate(data={"id": file.id}).get(with_valid=True) |
| 765 | |
| 766 | def one(self, with_valid=False): |
| 767 | self.is_valid(raise_exception=True) |
| 768 | query_set = QuerySet(model=Document) |
| 769 | query_set = query_set.filter(**{"id": self.data.get("document_id")}) |
| 770 | return native_search( |
| 771 | {"document_custom_sql": query_set, "order_by_query": QuerySet(Document).order_by("-create_time", "id")}, |
| 772 | select_string=get_file_content( |
| 773 | os.path.join(PROJECT_DIR, "apps", "knowledge", "sql", "list_document.sql") |
| 774 | ), |
| 775 | with_search_one=True, |
| 776 | ) |
| 777 | |
| 778 | def edit(self, instance: Dict, with_valid=False): |
| 779 | if with_valid: |
no test coverage detected