Releases: dymmond/edgy
Releases · dymmond/edgy
Version 0.19.1
Version 0.19.0
Added
- New
SET_DEFAULT
, andPROTECT
toon_delete
in the ForeignKey. - New
through_tablename
parameter for ManyToMany.
Removed
__db_model__
is removed. Replaced by registry = False.
Changed
- Allow setting registry = False, for disabling retrieving the registry from parents.
- Removed unecessary warning for ManyToMany.
- Add warnings for problematic combinations in ForeignKey.
- Make QuerySet nearly keyword only and deprecate keywords not matching function names.
- Clone QuerySet via
__init__
. - Make select_related variadic and deprecate former call taking a Sequence.
- Improved QuerySet caching.
Fixed
- Multi-column fields honor now
column_name
. This allows special characters in model names.
Version 0.18.1
Changed
- Cleanup Model inheritance: Database related operations are put into a mixin. The customized metaclass is moved from EdgyBaseModel to
edgy.Model
as well as some db related ClassVars. multi_related
is now a set containing tuples (from_fk, to_fk). This can be used to identify fields used by ManyToMany fields.- Deprecate
is_multi
. - Deprecate
parents
. There are no users, it was undocumented and uses are limited.
Fixed
- Non-abstract through-models wouldn't be marked as many to many relations.
- Issues related with the Edgy shell initialization.
Version 0.18.0
Added
- ComputedField.
- Permission template.
reverse_clean
for ForeignKeys.- Expanded filter methods of querysets (can pass now dict and querysets).
- Properly scoped
with_tenant
andwith_schema
.
Changed
- Managers use now instance attributes (database, schema).
- Expose
as_select
instead ofraw_query
. model_fields
contain now the fields so we can actually use the pydantic magic.- BREAKING: deprecate
set_tenant
and remove manager hack. This way the tenant scope could leak. Usewith_tenant
instead.
Fixed
select_related
works across ManyToMany fields.select_related
couldn't handle multiple pathes to the same table.select_related
would remove valid model instances because of non-existent related objects.- Fix identifying clashing column names in joins, so every model gets its right parameters.
- Dependency tracking for join, so it doesn't depend on the order of
select_related
. select_related
entries work in any order and don't overwrite each other.
-only
anddefer
work onselect_related
.- Autogenerated
id
wasn't added in model_dump. - Tenants worked only till the first query.
Breaking changes (upgrade path)
set_tenant("foo")
Becomes now
with with_tenant("foo"):
...
activate_schema("foo")
...
deactivate_schema()
Becomes now
with with_schema("foo"):
...
Version 0.17.4
Fixed
model_dump_json
returns right result.show_pk=False
can now be used to disable the inclusion of pk fields regardless of__show_pk__
.__setattr__
is called after insert/update. We have transform_input already.
Version 0.17.3
Fixed
- Lazy ManyToMany fields.
Version 0.17.2
Added
build_where_clause
method in QuerySet for easing the integration in raw SQLAlchemy queries.
Fixed
update
anddelete
methods of QuerySet did ignore or clauses.- Fixed ManyToMany fields not able to use their Owner Model as target.
- Fixed makemigration failing with foreignkeys when using model_apps.
Version 0.17.1
Added
CURRENT_MODEL_INSTANCE
ContextVariable which always point to a model instance.
Fixed
- Under circumstances it was possible for the assigned database attribute to appear as value.
- Typings of some (class) properties are now correctly detected.
- FileFields doesn't need an explicit
to_file
call assignment anymore to work with revisions. This restriction was lifted. - Execute database operation of
bulk_update
in right scope.
Version 0.17.0
Added
- Support for querying across multiple databases.
- Support for passing functions as clauses or keyword parameters.
- Support for autocreated reflection objects by pattern matching.
- Added some context variables for
extract_column_values
andtransform_input
:CURRENT_PHASE
: allows retrieving the current context in which it was executed.EXPLICIT_SPECIFIED_VALUES
: when set, it returns a set of the keys from the explicitly specified values.
Changed
crawl_relationship
has a slightly changed interface: it hascross_db_remainder
as kwarg for callbacks and in the result.
Also it doesn't raise NotImplementedError anymore when detecting a crossdb situation.is_cross_db
optionally gets a database as parameter and compares the databases instead of registries.- Relax fields parameter requirements for values/values_list.
- More lazy meta/metadata.
database
attribute of models is used for queries instead of the main database of the registry.- We use more metaclass kwarg arguments.
- Switch to python >= 3.9.
- Rename internal
_is_init
of MetaInfo to_fields_are_initialized
. phase
argument is shifted toCURRENT_PHASE
context_var. If you rely on the correct phase you need to use it instead.extract_column_values
provides now also aCURRENT_PHASE
environment.is_update
argument ofget_defaults
is now replaced byCURRENT_PHASE
too. It is way more accurate.- Deprecate
force_save
kwarg of save in favor offorce_insert
. This is way more precise. post_save_callback
receives now also theforce_insert
parameter.
Fixed
- Fix ForeignKey not None but empty hull under some conditions.
- Fix DecimalField requiring
max_digits
.
Version 0.16.0
Added
- ASGI, async context manager support to connect/disconnect multiple dbs at once.
create_all
/drop_all
,create_schema
/drop_schema
are now capable of initializing dbs in extra.- Add
transaction
helper to Model and QuerySet. - Allow copying models properly.
- Allow None as default.
Changed
- Unify
using
to allow setting schema and database via keyword arguments and deprecate both former calls.
Fixed
- Esmerald typing issues.
- Migration metadata was not completely initialized which caused problems.
- Foreign keys None/null handling was inconsistent. Now we have a None for unset foreign keys.