Skip to content

Conversation

@isadreddin
Copy link

No description provided.

support querying multiple hadiths at once.
support multiple hadith ids passed to the api
@Suhaibinator
Copy link
Contributor

See inline

abort(400, f"Too many URNs (max {MAX_URNS}).")

results = (
Hadith.query.filter(
Copy link
Author

Choose a reason for hiding this comment

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

SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL.

@Suhaibinator this should be equivalent to:

SELECT *
FROM hadith
WHERE english_urn IN (:u1, :u2, ...)
OR arabic_urn IN (:u1, :u2, ...);

@Suhaibinator
Copy link
Contributor

@isadreddin we support multiple languages however. Shouldn't such an API query all languages, not just English and Arabic?

@isadreddin
Copy link
Author

I was not aware of any other urns besides Arabic and English. Seems the existing api end point for retrieving a single Hadith behaves the same. Let me know.

@ahadith
Copy link
Contributor

ahadith commented Jan 26, 2026

Every hadith/translation will have a URN.

For now let's conform with the single hadith endpoint parameters; if it only supports Arabic and English let's move forward with this, if it supports others then let's have this support others as well.

But let's move to have both support all languages if the former is the case.

@isadreddin
Copy link
Author

singe hadith logic is as follows:
or_(Hadith.arabicURN == urn, Hadith.englishURN == urn)

can we merge the change?

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.

3 participants