Skip to content

Releases: dymmond/edgy

Version 0.21.2

05 Nov 09:05
0.21.2
8d18240
Compare
Choose a tag to compare

Added

  • PlaceholderField.
  • StrictModel which forbids extra attributes.

Changed

  • Validate on assignment is enabled.
  • IPAddressField uses now pydantic validation and a simplified TypeDecorator.
  • URLField is now validated.

Fixed

  • Pydantic validators are fixed. Field based ones as well as model based ones.
  • __dict__ was wiped out when intializing a model.

Version 0.21.1

30 Oct 22:26
0.21.1
35e2fe2
Compare
Choose a tag to compare

Changed

  • Breaking: from_kwargs doesn't require model or table anymore. It is simply ignored.

Fixed

  • Q, and_, or_ support now complex kwargs like querysets.
  • Failure querying when using proxy model table and kwargs.
  • Proxy and main model use now the same tables.
    This could have been a problem when filtering against table columns of the proxy table in a query from the main table.
  • Queries operate now always on the main model not the proxy model.
  • Stacklevel of performance warning was wrong.

Version 0.21.0

29 Oct 06:08
0.21.0
8634aea
Compare
Choose a tag to compare

Added

  • Allow multi schema and database migrations.
  • metadata_by_url dictionary.

Changed

  • metadata of registry is now metadata_by_name.
  • hash_tablekey uses a faster hash function.
  • Migrate object provides now a function for getting a suitable registry copy for migrations.
  • Change license to bsd-3.
  • Proper deprecate unset autoincrement when using it with primary key. The behavior is already deprecated in the documentation.

Fixed

  • Migrate executed refresh_metadata everytime causing reflected models to vanish.
  • Fix edgy wrapping esmerald with the asgi helper causing esmeralds cli to disappear.

Version 0.20.0

24 Oct 08:37
0.20.0
7b1e8ef
Compare
Choose a tag to compare

Added

  • Add DurationField.
  • Allow passing max_digits to FloatField.
  • Add local_or function to QuerySets.

Changed

  • Only the main table of a queryset is queryable via model_class.columns.foo == foo. Select related models have now an unique name for their path.
    The name can be retrieved via tables_and_models or using f"{hash_tablekey(...)}_{column}".
  • Breaking: Alter tables_and_models to use the prefix as key with '' for the maintable and model.
  • Breaking: Functions passed to filter functions reveive now a second positional parameter tables_and_models.
  • build_where_clause conditionally uses a subquery.
  • Rename QueryType to QuerySetType. The old name stays as an alias.
  • The debug property of QuerySet named sql inserts now the blanks and uses the dialect.

Fixed

  • Triggering load on non-existent field when reflecting.
  • InspectDB mapping was incorrect.
  • Fix query edge cases.
  • Fix using related queries with update/delete.

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.