use rx.Base instead of pydantic.BaseModel (fix for reflex 0.6.0)#20
Open
TimChild wants to merge 2 commits into
Open
use rx.Base instead of pydantic.BaseModel (fix for reflex 0.6.0)#20TimChild wants to merge 2 commits into
TimChild wants to merge 2 commits into
Conversation
|
@kroo can we get that merged, please? |
|
thanks for the PR. Seems to be affecting a lot of users. Any chance of getting this merged? @kroo |
|
Push, need it as well. :v |
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 |
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.
Since reflex 0.6.0, it's not valid to access attributes of pydantic models that don't sublcass from
rx.Basedirectly.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.Baseinstead, which itself inherits from pydantic.v1BaseModel. 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.