Migrate all partials components to FastAPI#11773
Merged
Conversation
e35dec0 to
03127d8
Compare
…in user functionality.
186159e to
7142f01
Compare
cdrini
approved these changes
Feb 18, 2026
Collaborator
cdrini
left a comment
There was a problem hiding this comment.
Testing:
- AffiliateLinksPartial - showed with prices
- BookPageListsPartial - worked on https://testing.openlibrary.org/books/OL28605186M/Improve_Your_Communication_Skills
- FullTextSuggestionsPartial - worked on https://testing.openlibrary.org/search?q=%22I+call+our+world+Flatland%2C+not+because+we+call+it+so%2C+but+to+make+its+nature+clearer+to+you%2C+my+happy+readers%2C+who+are+privileged+to+live+in+Space.%22&mode=everything
- SearchFacetsPartial - Worked on https://testing.openlibrary.org/search?q=harry+potter&mode=everything
- ReadingGoalProgressPartial - Worked
- MyBooksDropperListsPartial - Worked on search page
- LazyCarousel - https://testing.openlibrary.org/collections/hugo-awards
- CarouselLoadMore - Works on collections
Comment on lines
+96
to
+122
| def from_web_input(cls) -> "CarouselLoadMoreParams": | ||
| """Construct from web.py's web.input(), handling string-encoded booleans.""" | ||
| # TODO: Delete this complicated code after we switch to FastAPI | ||
| i = web.input( | ||
| queryType="", | ||
| q="", | ||
| limit=18, | ||
| page=1, | ||
| sorts="", | ||
| subject="", | ||
| hasFulltextOnly=False, | ||
| key="", | ||
| layout=None, | ||
| published_in="", | ||
| ) | ||
| return cls( | ||
| queryType=i.queryType, | ||
| q=i.q, | ||
| limit=int(i.limit), | ||
| page=int(i.page), | ||
| sorts=i.sorts, | ||
| subject=i.subject, | ||
| hasFulltextOnly=bool(i.hasFulltextOnly), | ||
| key=i.key, | ||
| layout=i.layout, | ||
| published_in=i.published_in, | ||
| ) |
Collaborator
There was a problem hiding this comment.
I think this can take advantage of the model validate method, eg
SolrInternalsParams.model_validate(dict(web_input))
Comment on lines
+99
to
+110
| i = web.input( | ||
| queryType="", | ||
| q="", | ||
| limit=18, | ||
| page=1, | ||
| sorts="", | ||
| subject="", | ||
| hasFulltextOnly=False, | ||
| key="", | ||
| layout=None, | ||
| published_in="", | ||
| ) |
Collaborator
There was a problem hiding this comment.
Maybe this might work: i = web.input(**dict(CarouselLoadMoreParams())) ; although like you said it's temporary so not worth spending too too much time on, although it would be nice for us to have a way to use the pydantic in both systems reliably.
Collaborator
|
Wooohooo fantastic work @RayBB big migration!! 🥳 |
1ddc2e8 to
62fe902
Compare
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.
Closes #
Technical
Testing
There are some test files in there that need to be deleted before merging. Just shows that the endpoint are in sync.
AffiliateLinksPartial
BookPageListsPartial
FullTextSuggestionsPartial
SearchFacetsPartial
ReadingGoalProgressPartial
MyBooksDropperListsPartial
LazyCarousel
CarouselLoadMore
Screenshot
Stakeholders