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

added page(s) to 341 line #274

Closed
wants to merge 2 commits into from

Conversation

MuhammadHasnain77
Copy link

No description provided.

@MuhammadHasnain77
Copy link
Author

is it correct?
I am new to github so I don't know much about it.

Copy link
Member

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

Hey @MuhammadHasnain77 and welcome to the Ragna project 👋 Unfortunately, it is not in the right place or better not in the right place I wanted it to have. Let me add a screenshot to the issue to get a better sense.

@@ -336,9 +336,16 @@ def on_click_source_info_wrapper(self, event, sources):
]
for rank, source in enumerate(sources, 1):
location = source["location"]
pages = source["document"].get("pages")
Copy link
Member

Choose a reason for hiding this comment

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

source["document"] does not have a field called pages. You can find the schemas here

class Source(BaseModel):
# See orm.Source on why this is not a UUID
id: str
document: Document
location: str

class Document(BaseModel):
id: uuid.UUID = Field(default_factory=uuid.uuid4)
name: str

The location field is what you want. You can check if it is a non-empty string and if yes, prepend page(s) to it. You can use the following existing block for it:

if location:
location = f": {location}"

@pmeier
Copy link
Member

pmeier commented Jan 18, 2024

@MuhammadHasnain77 we ended up touching the relevant lines in #264 and fixed #272 in the process. Thus, I'm closing this PR. Still, thanks for the effort.

@pmeier pmeier closed this Jan 18, 2024
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.

2 participants