sqladmin
sqladmin copied to clipboard
Add messages support
Checklist
- [X] 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.
@jonocodes Feel free to contribute to this if you want.
Do you mean "flash" messages from Flask?
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.
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.
Thanks. I got this working in my project. Here is what is looks like:
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.
Perfect, thanks
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?
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.
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?
You can see the tests. You setup an example application within the project and when you run that example app it shows your changes.
WIP: https://github.com/aminalaee/sqladmin/pull/770