Skip to content

Releases: artygo8/streamlit-sqlalchemy

0.2.4: fix: allow using None for foreign keys

30 May 11:19
Compare
Choose a tag to compare

fix: allow using None for foreign keys

AttributeError: 'NoneType' object has no attribute 'id'

If it were to fail, it should be on the DB side, not in the library.

0.2.3: fix: except_column failing with foreign keys

29 May 09:59
Compare
Choose a tag to compare

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

29 May 09:34
Compare
Choose a tag to compare

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

25 Mar 17:07
Compare
Choose a tag to compare

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

23 Feb 16:41
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.1.0...0.1.1

Thank you for opening #1 !

Beta

06 Jan 12:12
Compare
Choose a tag to compare

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

31 Dec 15:45
Compare
Choose a tag to compare

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 the st.connection for
    StreamlitAlchemyMixin initialization.
  • Remove the border from the forms (requires streamlit>=1.29.0)
  • st.rerun on st_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 from st_*_button to st.button.

assets/streamlit-example-2023-12-31-16-12-91.gif

v0.0.5

25 Dec 11:46
Compare
Choose a tag to compare

Preparing for Beta release !

First release

17 Dec 09:15
Compare
Choose a tag to compare

First release of the templating tool to help writing sqlalchemy objects usable with streamlit!