supadantic icon indicating copy to clipboard operation
supadantic copied to clipboard

add `refresh_from_db` method to `BaseSBModel`

Open makridenko opened this issue 5 months ago • 8 comments

makridenko avatar Jun 29 '25 15:06 makridenko

Hey @makridenko

I would like to try to solve this one :) Can you please assign it to me?)

darya-shynkevich avatar Jul 12 '25 20:07 darya-shynkevich

@darya-shynkevich sure :) If you have some questions -- feel free to ask :)

makridenko avatar Jul 12 '25 21:07 makridenko

@darya-shynkevich hi, any updates for it? maybe you have some questions?

makridenko avatar Jul 22 '25 10:07 makridenko

Hello @makridenko I am terrible sorry for such huge delay. I got a flue and was on the sick leave with doctor certificate during the whole last week :(

I am planning to start working on the issue today. I am sure I will have some questions ;)

darya-shynkevich avatar Jul 22 '25 13:07 darya-shynkevich

@darya-shynkevich don't worry, it's fully voluntary :) texted u just to know status

makridenko avatar Jul 22 '25 14:07 makridenko

@makridenko hey

Do you have a simple project where I can test the feature end-to-end or unit tests are enough ?

darya-shynkevich avatar Jul 28 '25 09:07 darya-shynkevich

Hi, @darya-shynkevich You can create absolutely free project at supabase :) There is fastapi guide, where you can find useful links End-to-end always better, sure

makridenko avatar Jul 28 '25 09:07 makridenko

Hey, I've managed to create a project based on the https://github.com/AtticusZeller/fastapi_supabase_template

Have not you contacted the owners of the template? maybe it is a good idea to add support of the library here? WDYT?

The refresh_from_db seems to work:

    user = User.objects.create(email="[email protected]")
    User.objects.filter(email="[email protected]").update(email="[email protected]")
    print(user)
    user.refresh_from_db()
    print(user)

https://github.com/user-attachments/assets/22c910b5-0ef6-4695-aced-9777b67d5518

darya-shynkevich avatar Jul 31 '25 16:07 darya-shynkevich