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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SQLAlchemy defaults in fields #503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

geoolekom
Copy link

@geoolekom geoolekom commented Feb 12, 2024

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.

image

@hasansezertasan
Copy link
Contributor

Related to #491

@geoolekom
Copy link
Author

Sorry, @hasansezertasan, any updates on this PR?

@hasansezertasan
Copy link
Contributor

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.

@@ -74,6 +75,7 @@ class BaseField:
id: str = ""
search_builder_type: Optional[str] = "default"
required: Optional[bool] = False
default: str = ""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default: str = ""
default: Optional[Any] = None

@jowilf
Copy link
Owner

jowilf commented Mar 6, 2024

Thank you, @geoolekom, for submitting this pull request. Would you be interested in implementing it for other backends as well?

@geoolekom
Copy link
Author

geoolekom commented Apr 18, 2024

Thank you, @geoolekom, for submitting this pull request. Would you be interested in implementing it for other backends as well?

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?

@geoolekom geoolekom requested a review from jowilf April 18, 2024 09:20
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.

None yet

3 participants