Skip to content
This repository was archived by the owner on May 25, 2026. It is now read-only.

refresh_from_db#96

Open
darya-shynkevich wants to merge 2 commits into
makridenko:masterfrom
darya-shynkevich:feature/90
Open

refresh_from_db#96
darya-shynkevich wants to merge 2 commits into
makridenko:masterfrom
darya-shynkevich:feature/90

Conversation

@darya-shynkevich

@darya-shynkevich darya-shynkevich commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

closes #90

Tested on my local project : https://github.com/darya-shynkevich/comment_generator

The local project is a bit messy, sorry for that. yet the refresh_from_db seems to work.

I also think it may be a good idea to contact the owners of the https://github.com/AtticusZeller/fastapi_supabase_template to integrate the library into it. WDYT?

@darya-shynkevich darya-shynkevich changed the title DRAFT: add refresh_from_db refresh_from_db Jul 31, 2025
@darya-shynkevich

Copy link
Copy Markdown
Contributor Author

@makridenko can you please review?)

@AlexPozh

AlexPozh commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

@makridenko can you please review?)

Hi, don't worry, he will check as soon as possible, thanks for ur PR! :)

@makridenko

Copy link
Copy Markdown
Owner

Hi, @darya-shynkevich
Sorry for delay, bit tough days

@makridenko

Copy link
Copy Markdown
Owner

I also think it may be a good idea to contact the owners of the https://github.com/AtticusZeller/fastapi_supabase_template to integrate the library into it. WDYT?

It's great idea. Maybe I will open a PR or you? :)
Or maybe @AlexPozh :)

@makridenko

Copy link
Copy Markdown
Owner

please add to PR description closes #issue_number

Comment thread tests/test_models.py
Comment thread tests/test_models.py Outdated
Comment thread supadantic/models.py Outdated
@makridenko

Copy link
Copy Markdown
Owner

@darya-shynkevich thank you!

@darya-shynkevich

Copy link
Copy Markdown
Contributor Author

I also think it may be a good idea to contact the owners of the https://github.com/AtticusZeller/fastapi_supabase_template to integrate the library into it. WDYT?

It's great idea. Maybe I will open a PR or you? :) Or maybe @AlexPozh :)

Maybe we can do it together?

@makridenko makridenko left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

thank you!

Comment thread supadantic/models.py
db_client = self._get_db_client()
raw: dict[str, Any] = db_client.execute(query_builder=query_builder)[0]

fresh = self.__class__.model_validate(raw, from_attributes=False)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

let's name it refreshed

@makridenko

Copy link
Copy Markdown
Owner

@darya-shynkevich I've been a bit busy, sorry, are you still in?

@darya-shynkevich

Copy link
Copy Markdown
Contributor Author

@darya-shynkevich I've been a bit busy, sorry, are you still in?

Hey, yep, I was a bit busy last week, will finish today :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add refresh_from_db method to BaseSBModel

3 participants