Skip to content

Releases: dymmond/edgy

Version 0.19.1

21 Oct 17:25
0.19.1
d6f6987
Compare
Choose a tag to compare

Fixed

  • Migration issues with ManyToMany fields.
  • Wrong UUIDField type.
  • Passing options from Migrate to the alembic context.

Version 0.19.0

17 Oct 07:21
0.19.0
2f9403d
Compare
Choose a tag to compare

Added

  • New SET_DEFAULT, and PROTECT to on_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

15 Oct 13:46
0.18.1
07af034
Compare
Choose a tag to compare

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

14 Oct 18:01
0.18.0
72c31bd
Compare
Choose a tag to compare

Added

  • ComputedField.
  • Permission template.
  • reverse_clean for ForeignKeys.
  • Expanded filter methods of querysets (can pass now dict and querysets).
  • Properly scoped with_tenant and with_schema.

Changed

  • Managers use now instance attributes (database, schema).
  • Expose as_select instead of raw_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. Use with_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 and defer work on select_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

11 Oct 01:24
0.17.4
2f543ec
Compare
Choose a tag to compare

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

09 Oct 16:14
0.17.3
a8791e0
Compare
Choose a tag to compare

Fixed

  • Lazy ManyToMany fields.

Version 0.17.2

06 Oct 16:15
0.17.2
9bcfca4
Compare
Choose a tag to compare

Added

  • build_where_clause method in QuerySet for easing the integration in raw SQLAlchemy queries.

Fixed

  • update and delete 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

04 Oct 07:26
0.17.1
8915ff7
Compare
Choose a tag to compare

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

30 Sep 03:25
80f019c
Compare
Choose a tag to compare

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 and transform_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 has cross_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 to CURRENT_PHASE context_var. If you rely on the correct phase you need to use it instead.
  • extract_column_values provides now also a CURRENT_PHASE environment.
  • is_update argument of get_defaults is now replaced by CURRENT_PHASE too. It is way more accurate.
  • Deprecate force_save kwarg of save in favor of force_insert. This is way more precise.
  • post_save_callback receives now also the force_insert parameter.

Fixed

  • Fix ForeignKey not None but empty hull under some conditions.
  • Fix DecimalField requiring max_digits.

Version 0.16.0

19 Sep 17:35
339808e
Compare
Choose a tag to compare

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.