Releases: artygo8/streamlit-sqlalchemy
0.2.4: fix: allow using None for foreign keys
0.2.3: fix: except_column failing with foreign keys
fix: except_column failing with foreign keys
Traceback (most recent call last):
File "/home/agossuin/.local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.__dict__)
File "/home/agossuin/...", line 42, in my_class_view
MyClass.st_crud_tabs(
File "/home/agossuin/.local/lib/python3.10/site-packages/streamlit_sqlalchemy/mixin.py", line 288, in st_crud_tabs
cls.st_update_select_form(
File "/home/agossuin/.local/lib/python3.10/site-packages/streamlit_sqlalchemy/mixin.py", line 228, in st_update_select_form
if selected_obj_to_update.st_update_form(
File "/home/agossuin/.local/lib/python3.10/site-packages/streamlit_sqlalchemy/mixin.py", line 582, in st_update_form
kwargs[field] = kwargs[field].id
AttributeError: 'int' object has no attribute 'id'
- small typehinting addition
0.2.2: feat: add streamlit tooltips from SQLObjects
feat: return submitted state
Because we did not have access to the submitted state, manual control
flow was complicated. For instance, creating an object from an
st.experimental_dialog
was impossible.
This can still be improved, but for now it already makes things more
manageable.
in the future, st_update_select_form and st_delete_select_form as well
as st_crud_tabs should return a boolean with the submit status, but it
is not strictly necessary for now because they internally call st.rerun
anyway.
feat: add streamlit tooltips from SQLObjects
The doc
arg can be passed to the Column
objects, and will be displayed
as an helper tooltip on streamlit selectors.
more info on doc
: https://docs.sqlalchemy.org/en/13/core/metadata.html#sqlalchemy.schema.Column.params.doc
0.2.0
fix!: Add the many2one in update form
Originally, the many2one were not added to the update form because of
my single usecase. However it absolutely makes sense to be able to
modify the many2one relationships.
To keep the original behiaviour, you can use the except_columns
kwarg and add each of the _id ending fields.
BREAKING CHANGE: Now you have the many2one by default in the update
form.
Refs: #3
0.1.1
Beta
Main changes:
- Optional
filter_by: dict
kwarg for*_select_form
to display only
the elements you are interested in. (ex: filter on foreign key) - Optional
except_columns: list
for_form
methods: column names to
exclude from the form. - Ensure the default value from the Column declaration is set.
Meta elements:
__st_input_meta__
: specify custom streamlit components for your
columns.__st_repr__
: specify how an SQLAlchemy object is displayed in a
selectbox
.__st_order_by__
: specify how SQLAlchemy objects are ordered in a
selectbox
.
New column types supported:
- Float: similar to int but with 0.1 steps
- Datetime: 2 input elements - Date & Time
- Date: st.date_input
- Time: st.time_input
- Text: st.text_area
Details:
- Add KWO arg
border=False
to methods containing forms
(streamlit>=1.29.0)
v0.0.6
Changes:
- Use unique hashes to avoid form clashes (using md5).
- Remove the ' Id' at the end in the column names for display.
- Replace
engine
(sql Alchemy) by thest.connection
for
StreamlitAlchemyMixin initialization. - Remove the border from the forms (requires
streamlit>=1.29.0
) st.rerun
onst_update_select_forms
as well as on
st_delete_select_form
.- Add support for boolean Columns - using selectbox to allow None
as possible value. - Pass
kwargs
fromst_*_button
tost.button
.
v0.0.5
First release
First release of the templating tool to help writing sqlalchemy objects usable with streamlit!