Open arminposchmann opened 7 months ago
Could you download the latest master version? here's a link to download the zip
I’m not actively working on this project, but left the master version in a good working state. All the SQLite examples should work.
Yes, after downloading and installing from git, most of what i am interested in is working.
I managed to reskin everything with little extensions to psg_reskinner and most easy demos are running.
What i'm interested in is transforming the data: set_transform(ss.simple_transform)
There is a demo journal_with data_manipulation.py that shows exactly the transform i would like to use,
but the demo fails on the requery call.
See the output below:
2024-04-03 17:48:34.561 | INFO | pysimplesql.pysimplesql:execute:10059 - Executing query: SELECT "Journal".* FROM "Journal" LEFT JOIN "Mood" ON "Journal"."mood_id"="Mood"."id" ORDER BY entry_date DESC None
2024-04-03 17:48:34.562 | DEBUG | pysimplesql.pysimplesql:get_value:824 - Getting current record for Journal.id
2024-04-03 17:48:34.563 | DEBUG | pysimplesql.pysimplesql:sort:3313 - Sort column is None. Resetting sort.
2024-04-03 17:48:34.563 | DEBUG | pysimplesql.pysimplesql:set_by_pk:1997 - Setting table Journal record by primary key 1
2024-04-03 17:48:34.563 | DEBUG | pysimplesql.pysimplesql:update_selectors:4675 - update_elements: SELECTOR FOUND
2024-04-03 17:48:34.563 | DEBUG | pysimplesql.pysimplesql:update_selectors:4681 - <class 'pysimplesql.pysimplesql.LazyTable'>
2024-04-03 17:48:34.563 | DEBUG | pysimplesql.pysimplesql:update_selectors:4725 - update_elements: Table selector found...
2024-04-03 17:48:34.569 | DEBUG | pysimplesql.pysimplesql:get_value:824 - Getting current record for Journal.id
2024-04-03 17:48:34.570 | DEBUG | pysimplesql.pysimplesql:update_selectors:4762 - Selector:: index:[0] found:True
2024-04-03 17:48:34.572 | DEBUG | pysimplesql.pysimplesql:simple_transform:4995 - Transforming entry_date from 1712159314 to 04/03/24
2024-04-03 17:48:34.575 | DEBUG | pysimplesql.pysimplesql:first:1639 - Moving to the first record of table Journal
2024-04-03 17:48:34.575 | DEBUG | pysimplesql.pysimplesql:update_elements:4366 - update_elements(): Updating PySimpleGUI elements
2024-04-03 17:48:34.575 | DEBUG | pysimplesql.pysimplesql:update_element_states:4893 - Updating element Journal.entry_date to disabled: False, visible: None
2024-04-03 17:48:34.576 | DEBUG | pysimplesql.pysimplesql:update_element_states:4893 - Updating element Journal.mood_id to disabled: False, visible: None
2024-04-03 17:48:34.576 | DEBUG | pysimplesql.pysimplesql:update_element_states:4893 - Updating element Journal.title to disabled: False, visible: None
2024-04-03 17:48:34.576 | DEBUG | pysimplesql.pysimplesql:update_element_states:4893 - Updating element Journal.entry to disabled: False, visible: None
Traceback (most recent call last):
File "/home/ap/pydev/testpy/testfiles/sql/.journal_with_data_manipulation.py", line 74, in
Thank you for your answer. This project is very interesting!
Regards Armin
That shouldn’t be too difficult to fix. Looks like we assume “virtual” key is there when it isn’t. I’ll push a fix for that when I have a second
See if master now works for you!
The stacktrace changed a little bit, but it does not work.
INFO:pysimplesql.pysimplesql:Executing query: SELECT "Journal".* FROM "Journal" LEFT JOIN "Mood" ON "Journal"."mood_id"="Mood"."id" ORDER BY entry_date DESC None
Traceback (most recent call last):
File "/home/ap/pydev/testpy/testfiles/sql/pysimplesql/examples/SQLite_examples/journal_with_data_manipulation.py", line 74, in
Ah ok. Let me dig a little deeper and figure out where we arnt populating the attrs dictionary with (at least) empty values
Hi all, i stumbled about this project when looking for a way to sort PysimpleGui Tables and have a headings marker for the sorting. Then i tried the version 2.3.0 of this project and could only get the Restaurant demo to run. All the Fruit examples fail with Traceback (most recent call last): File "/home/ap/pydev/testpy/testfiles/fruit4.py", line 20, in
ss.record(table, 'name', label='Fruit Name'), # pysimplesql.record() convenience function for easy record creation!
File "/home/ap/.local/lib/python3.10/site-packages/pysimplesql/pysimplesql.py", line 2392, in record
label_text = queryinfo.split('.')[1].replace('fk', '').replace('', ' ').capitalize() + ':'
IndexError: list index out of range
Is there a way to get a demo that works with a sg.Table and is able to sort ? I tried with PySimpleGUI 4.6.1 and with PySimpleGUI 5.0.3