-
Notifications
You must be signed in to change notification settings - Fork 61
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SQLAlchemy defaults in fields #503
base: main
Are you sure you want to change the base?
Conversation
Related to #491 |
Sorry, @hasansezertasan, any updates on this PR? |
It's OK. I was the one who volunteered but I couldn't get my hands free for this. I'll work on it when I get a chance. |
starlette_admin/fields.py
Outdated
@@ -74,6 +75,7 @@ class BaseField: | |||
id: str = "" | |||
search_builder_type: Optional[str] = "default" | |||
required: Optional[bool] = False | |||
default: str = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default: str = "" | |
default: Optional[Any] = None |
Thank you, @geoolekom, for submitting this pull request. Would you be interested in implementing it for other backends as well? |
f17d460
to
0c1ad9d
Compare
Unfortunately, for now I don't have much time to implement other backends in this PR. Perhaps later, in a separate pull request. For now, I fixed failed CI checks for SQLA backend. Could you trigger the pipeline again? |
ca3699e
to
a0da93d
Compare
Hi, I'm wondering if there's any work remaining on this that I could assist with. It would be nice to have for a project I'm working on. |
Now, if a SQLA Column has a default value, it is used in the admin panel. If it is a scalar, then the value is used directly. If it is a function or SQL expression, the extra help text is displayed.