### BREAKING CHANGE
#### Datetime, Date and Time fields will always be cast to respective objects in `setattr`, this will ensure uniformity while accessing the values, no more `getdate`, `get_datetime`, `to_timedelta` wrapper.
- While importing data, the framework does check for `set_only_once`.
- In normal case scenarios, this will work flawlessly since most date fields might not be set_only_once.
- But in Subscription, the date field is set to `set_only_once` and in `after_insert`, `document.save` is called, and while doing so, `set_only_once` is checked [here](1944a547f9/frappe/model/document.py (L566)).
-This works fine if the data imported is in the correct format.
- If the date's data is not in the correct format, the framework throws an error.
- for eg `06-02-2022 00:00:00 != 06-02-2022`
- fixes [Issue/#15370](https://github.com/frappe/frappe/issues/15370)
> no-docs
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
* Small fixes in set_fields and clean code
* Optimize casefolds
* Fixed functions passed in List
* get_sql => get_query - more expressive, less confusion
* Updated tests
* feat: supporting empty iterables for Contains objects
* fix: explicitly setting empty iterables as tuples to support more operators
* feat: Added locate to frappe.qb Functions
* feat: Added support for functions passed as strings in fields
* feat: Included Criterion objects as fields
* fix: picking up only function intended fields to pass to get_function_objects
* feat: Added iterable for available functions, added support for Field objects
* fix: fixed * passed in fields in lists
* feat: Added support for True as filter and pluck in the query engine
* feat: Added join support
* fix: return if filters are None
* feat: Added support for sets as filters and additional conditions
* fix: fixed IS operator in query builder
* feat: Added support for 'as' in query engine
* fix: fixed 'as' for criterion objects passed directly
* fix: fixed frappe.db.count
* fix: fixed functions in fieldname
* feat: Added support for multiple fields passed as a single string :) fixed None fields in a list
* feat: Added support for "as" in single string fields
* fix: fixed queries with invalid syntax
* Cast single's values as their fieldtypes before returning
* Support previously dead debug parameter
* Consider single with no meta as non-existent; skip query
Decided to go ahead with the breaking change given the nature of the
existing usages of get_singles_dict :crie:
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.
Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
* Added provision for semi-implemneted version
* Hard to fix it completely given it's broken on develop / desk
* Added TODO for adding nestedset related filters
* fix: misc fixes
local.x gets resetted on every request so switched to a simple dict
simplified is_val_used in set_next_val function for sequences
* chore: use multisql for sequence methods
* fix: fields not updating on form
* minor(base_input): removed unnecessary branching in update_input
* chore: remove prints and rename autoincremented_status_map
* chore: added proper type hint + comment + formatting
* fix: added searching in cast_name rather than handling it manually
* fix: share condition query + test_build_match_conditions
* fix: add cast_name to more places
* test: test for sequence
* fix: sequence functions
* fix: inherit frappetestcase
* minor: attach sequence methods to db context local
* chore: update sequence function names in Database
use frappe.db for sequences in naming.py
* fix: convert filename to str (for autoincremented doctypes)
* chore: better regex for modifying values for postgres
* minor: allow changing name column type (if no data is present in the doctype)
* refactor: validate_autoname
converted it to a simple function
enabled changing autoincrement autoname from customize form
* fix: use sql_ddl for change_column_type in postgres
* fix: use not null constraint in postgres when changing name type
* fix(test): updated test_autoincremented_doctype_transition with transitioning when no data is present
* fix(test): updated test_cast_name
probably messed up during rebase
* fix(test): used rollback upon error in transaction for postgres
* chore: use frappe.db.x methods for sequences
* minor: use temporary sequences in test
* minor: use generate_hash for sequence naming in sequence tests
* chore: replace sequence imports with frappe.db.x
* chore: move out casting name fields to a separate method
* refactor: cast_name
more explicit cases for casts and added docstring
* fix: added space in test_cast_name
* chore: fix linter
* chore: better naming for can_change_name_column_type
* chore: add comment for autoincremented_site_status_map
* chore: update/add docstrings