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

Add messages support #700

Open
1 task done
jonocodes opened this issue Jan 19, 2024 · 11 comments
Open
1 task done

Add messages support #700

jonocodes opened this issue Jan 19, 2024 · 11 comments

Comments

@jonocodes
Copy link
Contributor

jonocodes commented Jan 19, 2024

Checklist

  • There are no similar issues or pull requests for this yet.

Is your feature related to a problem? Please describe.

I would like to display feedback to users after a form submission, not just error messages. This would allow for warnings and success messages.

Describe the solution you would like.

Django Admin uses this
https://docs.djangoproject.com/en/dev/ref/contrib/messages/#django.contrib.messages.add_message

Describe alternatives you considered

No response

Additional context

I may be willing to work on this, if there is interest.

@aminalaee
Copy link
Owner

@jonocodes Feel free to contribute to this if you want.

@hasansezertasan
Copy link
Contributor

Do you mean "flash" messages from Flask?

@jonocodes
Copy link
Contributor Author

Do you mean "flash" messages from Flask?

I have not used Flask, but looking at that it does seem to be what I'm talking about.

@hasansezertasan
Copy link
Contributor

Do you mean "flash" messages from Flask?

I have not used Flask, but looking at that it does seem to be what I'm talking about.

I recommend you to check starlette-flash package.

It's very light but depends on SessionMiddleware to work.

@jonocodes
Copy link
Contributor Author

Thanks. I got this working in my project. Here is what is looks like:

image

I roughly followed this: https://medium.com/@arunksoman5678/fastapi-flash-message-like-flask-f0970605031a

Which works with like your middleware suggestion above. And then it uses tabler's alert components.

Once I figure out how to get a dev setup in sqladmin I will submit it there.

@aminalaee
Copy link
Owner

Perfect, thanks

@jonocodes
Copy link
Contributor Author

In practice how does one go about developing a feature in the core project? Do I start a demo project locally and link in the local sqladmin libs to see the changes there? Is there a particular demo to work off?

@aminalaee
Copy link
Owner

You can check this: https://github.com/aminalaee/sqladmin/blob/main/CONTRIBUTING.md
Chances are some steps might be old or wrong, but it should give you the idea how to contribute.

@jonocodes
Copy link
Contributor Author

You can check this: https://github.com/aminalaee/sqladmin/blob/main/CONTRIBUTING.md
Chances are some steps might be old or wrong, but it should give you the idea how to contribute.

That doc explains how to checkout and build. But where do I actually run something to see my changes?

@aminalaee
Copy link
Owner

You can see the tests. You setup an example application within the project and when you run that example app it shows your changes.

@jonocodes
Copy link
Contributor Author

WIP: #770

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

No branches or pull requests

3 participants