Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLModel support #57

Closed
aminalaee opened this issue Feb 17, 2022 Discussed in #56 · 8 comments 路 Fixed by #94
Closed

SQLModel support #57

aminalaee opened this issue Feb 17, 2022 Discussed in #56 · 8 comments 路 Fixed by #94
Labels
enhancement New feature or request

Comments

@aminalaee
Copy link
Owner

Discussed in #56

Originally posted by JonasKs February 16, 2022
Hi! This looks awesome, I鈥檓 definitely going to test it out!

Since this support SQLAlchemy, will it also support SQLModel? 馃槉

As suggested by @JonasKs, I did test SQLAdmin with SQLModel but it needs a few tweaks to make it work.
I'll get to it after we have the minimum functionality like #24 done.

@aminalaee aminalaee added the enhancement New feature or request label Feb 17, 2022
@aminalaee
Copy link
Owner Author

Thanks a lot for the suggestion 馃憤

@JonasKs
Copy link

JonasKs commented Feb 17, 2022

Thank you! Looking forward to it!

@ischaojie
Copy link
Contributor

ischaojie commented Feb 23, 2022

Awesome! SQLModel use pydantic for type annotation, that is better for model convert to forms, for example,

name: str = Field(max_length=12)
age: int = Field(ge=0, le=100)

We can auto-add validators( like validators.Length()) for name and age fields in wtforms Forms.

If needed, I wish to provide some contribution to it.

@aminalaee
Copy link
Owner Author

Honestly I haven't taken a deep look into it, but yeah maybe something like that will do it.

What I suggest is to split that into multiple PRs, so my first attempt would be to just make it work with SQLModel because right now the field conversion fails.
Then we. can work on it and improve the validations.
Even in that, if any PR will be big we can split it into parts.

If needed, I wish to provide some contribution to it.

That would be more than welcome, feel free to go for it 馃憤

@EZhivaikin
Copy link

Hi! Do you want to add fully support of sqlmodel? I just have done some "tweaks" to make it work in my current project, and can make a PR. By the way, if there is some requirements, I would try to help

@aminalaee
Copy link
Owner Author

Hey @EZhivaikin ,
Yes ideally I think SQLAdmin should work with SQLModel, but as far as I saw we only need to defined the converters for creating wtform field validators in SQLModel.

And yes, all sorts of contributions are welcome, please do create a PR for it 馃憤

As for other improvements, my initial goal is to support the flask-admin features, there are still some of them missing here. So what I suggest is that if you want/can help with anything first let's create an issue and then do the PRs. How does that sound?

@EZhivaikin
Copy link

Sounds great, I'll try to do this all asap 馃槂

@aminalaee
Copy link
Owner Author

I've created a PR to add SQLModel support in SQLAdmin. It would be appreciated if anyone could take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants