Skip to content

Conversation

@ssweber
Copy link
Collaborator

@ssweber ssweber commented Aug 3, 2023

No description provided.

@ssweber ssweber merged commit 56f08ab into wip Aug 3, 2023
@ssweber ssweber deleted the doc-rework branch August 3, 2023 03:34
ssweber added a commit that referenced this pull request Sep 20, 2023
* Refactor: update examples to reflect new 'allow_cell_edits'

sort_enable is on by default, so we can remove that.
renamed `edit_enable` -> allow_cell_edits

* Ruff: ignore `value == ""` rule

* Create jackcess-4.0.5.jar

As an option, if someone has a newer msaccess file that has 'attachment' column

* Fix: Correct `Ready` msgs for docker_util

This fixes all the 'problem connecting' errors for me

* Feat: New multi-db orders example

Sqlite, Mysql, Postgres, SqlServer, and Msaccess!

Sporting alot of new features:
- basic validators for all columns
- updating a sg.StatusBar and/or sg.Text with info-msgs
- Custom validator for email field in `customer` quick-editor

* Feat: install_java, save previous jre install

* Refactor: remove triggers from orders.py, align closer to multidb orders

* nit: pd.options formatting

* nit: imports

* nit: new constant TYPE_INFO

used in automatically updating sg.StatusBar and/or sg.Text

* Fix: new constant EMPTY

Fixed a placeholder issue with it.

* Refactor: change datetype str to CONSTANTS

* Refactor: Relationship to dataclass and reorder to be like other classes

* Refactor: Elementmap to dataclass

* Fix: _invoke_callback

* Rename: 'current_row_updated' -> after_record_edit

* Feat: new `column_info_settings` for quick_editor

This allows setting column_info attributes. The dataset is generated, so this setting custom attributes.

* Feat: Info StatusBar for quick_editor

* Feat: an `info_element`

Adds an info-element that displays the str of an info msg. Useful to use as a status bar.

Form.add_info_element is called in auto_map_elements

Then popup handles updating them when an info msg is created.

* Big Feat: refactor Column and add new specialized Col classes

Changed Column to a dataclass
Added:
-BoolCol
-DateCol
-DateTimeCol
-DecimalCol
-FloatCol
-IntCol
-StrCol
-TimeCol

and also two `base col classes`:

LengthCol
MinMaxCol

that the others subclass

* Fix: bool column mapping was broken

* Fix: I broke sorting

* Refactor: use new python_type vs domain

* Refactor/Feat: SqlDriver

new functions:
- parse_domain
- get_column_class

* Refactor/Feat/Fix: Sqlite driver

added Decimal handling for sqlite

Added:
COLUMN_CLASS_MAP
SQL_CONSTANTS

Fixed: generated capturing
Moved: execute_script

* Refactor/Feat: MysqlDriver

Added:
COLUMN_CLASS_MAP
SQL_CONSTANTS

new arg: tinyint1_is_boolean

Fixed executescript (mysql doesn't have one)

Converted to use new specialized type Cols

Fixed duplicate handling - mysql doesn't have a 'RETURNING'

* Feat/Refactor: Postgres driver

Added
COLUMN_CLASS_MAP
SQL_CONSTANTS

added an execute_script function, and correct sql_commands function

* Refactor/Feat: SqlServer

Add and use COLUMN_CLASS_MAP
Add SQL_CONSTANTS

get generated columns
fix execute_script / sql_commands

* Refactor/Feat: MsAccess driver

-Add/use COLUMN_CLASS_MAP
-add ability to create an access file, and overwrite one
-infer datetype column from column default (if there is one)
create/fix sql_commands/sql_file

* Nit: forgot line in sqlite driver

* Refactor _looks_like_a_function to use SQL_CONSTANTS and simpler regex

* Feat: _shake_animation

* Refactor: _PlaceholderText

* Refactor: Reuse code in Combo classes

* Fix: broken datepicker entry

* Nit: use tk contants in DatePicker

* Feat: use cast in DatePicker

* Rename TableHeading args

* Feat: New Validate classes

enums: ValidateRule
dataclass: ValidateRepsonse

* Feat: Use Validate and _shake_animation

* Nit: ruff fix

* Fix: use get_pk_ignore_placeholder in LiveUpdate

* Update Themepack to match new features

* Update LanguagePack to use new features

* Nit: remove order=True

Not needed for comparison of individual values

* Feat: Add validate checking before save to DataSet save_records

* Refactor: new Dataset function validate_field

* Fix: _shake_animation, don't move other elements

* Refactor/ allow validate exception animation to be more easily changed

* Nit: change indent

* Feat: Allow passing column attrs to quick_editor in fields

* Nit: change default Column python_type to object, ditch the special-cased if

* Better Sqlite Column mapping

Since you can basically use whatever name you want in sqlite, lets make it more flexible.

* Feat: adapters for date/datetime/time sqlite

* Convert all Col classes to dataclasses, use __post_init__ to assign domain_args

This allows automatic type-hinting/args/kwargs in pycharm.

I didn't feel good about how we were 'magically' assigning domain_args by putting them first anyway.

* Nit: ruff formatting

* Fix: typing hint

* Cleanup: ColClasses

I didn't need to use __post_init__, I just needed to add type-hints, then they would be overwrite Column python_type

* Cleanup: DecimalCol

Match Pony's defaults of 12/2.

I debated using max_digits, and decimal_places... but I think precision/scale are more common

* Refactor: popup

Go back to using window, rather than needing a frm

Consolidate window kwargs

* Fixes for examples

Going through examples and fixing them for ColumnClasses, and other little things.

* Fix: Move transform above validate in DataSet.save_record

Not sure what the end-story is for transform, but it makes sense to apply encode-transforms before validating.

* Ruff fix

* Fix/Simplify: _invoke_callback

* Ruff: enable pandas-vet, pep8-naming

* Ruff: enable #flake8-comprehensions, #flake8-bugbear

* Ruff: Enable 'PIE'

* Ruff: Enable NPY rules

* Ruff: Enable Ruff rules

* Added a STRICT validate mode

* nit: black fix

* Feat: Better Locale for Column Casting

* Feat: Cell Formatting in table-values!

Now you can apply formatting that isn't actually in the Rows dataframe, but only shows up in the table!

`frm[data_key].column_info[column_name].cell_format_fn = callable that accepts 1 argument

* TableHeadings -> TableBuilder (#339)

* TableBuilder initial

* Refactoring

* update examples to work with new TableBuilder

* Nit: col/headings_justification / anchor cleanup

Pass 'justify' as "l", "r", "c", like PySimpleGUI does its cols_justification

Pass 'anchor' for tk heading() function as "w", "e", "center" for tkinter.

* Update sqlite-only orders.py to match multiple

* Refactor DataSet as dataclass, add _LastSearch class

* Cleanup constants

* convert Form to a dataclass

* ruff fix

* Fix: Don't generate __eq__ for DataSet

* Fix: Don't add __eq__ to Form either

* Fix: Don't close quick_editor until frm has refreshed

Fixes bug where you can close quick_editor, and close frm window too quickly causing a tkinter error

* Work on Relationship

* Revert "Work on Relationship"

This reverts commit 732eb00.

* Fix converted dataclass (DataSet/Form/TableBuilder)

I didn't understand how init=False worked. So I had accidently turned these into ClassVars, not instance attributes, whoops!

* Convert SqlDrivers to Dataclasses, and Move Relationships to Driver

It makes most sense to the list of relationships be bound to the driver.

Multiple forms can share 1 driver, but each Form only has 1 driver. This way, there can be multiple drivers in use, but we arn't using class instances to lookup tables/columns/etc.

* Fixes for MsAccess

Don't return numpy types for rows
Fix function handling
Register some adapters for date/datetime/tmie

* Ruff/Black fixes

* Move MsAccess adapters/converters to an extendable framework

* Fix for Postgres, use pk/pk_column

* Remove redundant `insert_record` in msaccess

It was duplicate of SQLServer's version

* Fix: Small fix for pk column

* Fix: Remove quick_editor Form from Form Instances

* Fix: Convert numpy.int64 to int correctly

* Ruff/Black fixes

* Fixes for opening a database without any records

* Fix Postgres, get columns in order of creation (like other drivers)

* Remove prefix_data_keys Form init option

This is currently broken, so removing for now until there is a viable strategy for implementing.

* Rows will always have (at least) an empty dataframe

Too many bugs generated if it is None

* Feat: add `close_driver` arg to Form.close()

Allows quick_editor (or others) that share driver to close without closing driver.

* Update ColumnInfo example

* Make a few more classes Private

* Ruff/Black

* Ruff fixes (had to upgrade to match github action

* Convert to Google-style docstrings

* Update .git-blame-ignore-revs

* Change mkdocstrings to google

Fix a few 'Critical' mkdocstrings errors

* Rename _LastSearch to _PrevSearch

Adds clarity, since Last is used elsewhere for the last record of a table, not previous :)

* Docs

* Docs

* Large Docs update (#341)

* ValidateRule documentation

* Update pysimplesql.py

* Update pysimplesql.py

* docs

* Docs

* Docs

* autotyping 1 of

* --bool-param

* --int-param, --float-param, --str-param, --bytes-param

* --int-param, --float-param, --str-param, --bytes-param

* --annotate-magics

* type hinting

* Docs, and moving constants to enums

* Fix: Check for 'TableBuilder' key intead of searching metadata

* Update pysimplesql.py

* import dataclass as dataclass, so we don't have to use dc. everywhere

* use init=False to make these instance vars only

* Get ruff to pass, harmonize sql_script/sql_commands

* Rename parent_virtual, to is_parent_virtual

Small fix too

* .

* nits

* Update .gitignore

* Move `current` functions under DataSet.current

* Refactor current.get_pk() -> `@property current.pk

* Update pysimplesql.py

* Black fix

* get ruff to pass

* More ruff fixes (new version disallows comparing with "is"

* black fix
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

Successfully merging this pull request may close these issues.

2 participants