Skip to content

Migrate all partials components to FastAPI#11773

Merged
cdrini merged 36 commits intomasterfrom
fastapi/partials-v2
Feb 18, 2026
Merged

Migrate all partials components to FastAPI#11773
cdrini merged 36 commits intomasterfrom
fastapi/partials-v2

Conversation

@RayBB
Copy link
Collaborator

@RayBB RayBB commented Jan 29, 2026

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

@RayBB RayBB marked this pull request as ready for review February 3, 2026 23:17
@RayBB RayBB changed the title migrate facets partial to fastapi migrate several partials components to FastAPI Feb 4, 2026
@RayBB RayBB force-pushed the fastapi/partials-v2 branch from e35dec0 to 03127d8 Compare February 13, 2026 08:34
@RayBB RayBB force-pushed the fastapi/partials-v2 branch from 186159e to 7142f01 Compare February 18, 2026 07:18
@RayBB RayBB changed the title migrate several partials components to FastAPI Migrate all partials components to FastAPI Feb 18, 2026
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Testing:

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,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

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="",
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

@cdrini
Copy link
Collaborator

cdrini commented Feb 18, 2026

Wooohooo fantastic work @RayBB big migration!! 🥳

@RayBB RayBB force-pushed the fastapi/partials-v2 branch from 1ddc2e8 to 62fe902 Compare February 18, 2026 20:18
@cdrini cdrini merged commit b150b32 into master Feb 18, 2026
9 checks passed
@cdrini cdrini deleted the fastapi/partials-v2 branch February 18, 2026 20:20
@RayBB RayBB mentioned this pull request Feb 18, 2026
2 tasks
@RayBB RayBB removed the On Testing label Feb 18, 2026
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