Skip to content

use rx.Base instead of pydantic.BaseModel (fix for reflex 0.6.0)#20

Open
TimChild wants to merge 2 commits into
kroo:masterfrom
TimChild:master
Open

use rx.Base instead of pydantic.BaseModel (fix for reflex 0.6.0)#20
TimChild wants to merge 2 commits into
kroo:masterfrom
TimChild:master

Conversation

@TimChild

@TimChild TimChild commented Oct 4, 2024

Copy link
Copy Markdown

Since reflex 0.6.0, it's not valid to access attributes of pydantic models that don't sublcass from rx.Base directly.
For example, ClerkState.user.first_name... Trying to do this results in the issue reported in #18 .

Solution is to have the models subclass rx.Base instead, which itself inherits from pydantic.v1 BaseModel. This should also mean that this will remain compatible if/when reflex switches to using pydantic v2 since the models in reflex-clerk don't use any featuresr that are specific to v1 or v2 pydantic.

I also committed an addition to the .gitignore in the clerk_demo folder just because reflex 0.6.0 adds this when running anyway.

@boittega

Copy link
Copy Markdown

@kroo can we get that merged, please?

@gururise

gururise commented Nov 4, 2024

Copy link
Copy Markdown

thanks for the PR. Seems to be affecting a lot of users.

Any chance of getting this merged? @kroo

@tobsome

tobsome commented Dec 6, 2024

Copy link
Copy Markdown

Push, need it as well. :v

@TimChild

Copy link
Copy Markdown
Author

Since this is no longer maintained, I've created a new and improved clerk plugin that is fully updated for reflex 0.7.x
You can find it here https://github.com/TimChild/reflex-clerk-api

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.

4 participants