Edgy

Latest version: v0.27.0

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 9

0.27.0

Changed

- Added a new table naming schema for through models of ManyToMany fields. This requires however setting
an explicit table naming schema via the `through_tablename` parameter.
- When `through_tablename` is a string, it is formatted with the field injected as field in the context.

Fixed

- Multiple ManyFields from the same model to the same target model. Note: this is unrelated to `related_name`, setting the
the `related_name` would not help.

BREAKING

For now ManyToMany fields **must** explicitly have a `through_tablename` parameter in which
the table naming schema for the through model is selected.
For existing ManyToMany fields you should pass `edgy.OLD_M2M_NAMING"` so migrations doesn't drop the tables,
for new ManyToMany fields `edgy.NEW_M2M_NAMING"` which prevents clashes of through model names.
You may can also rename the through model table via migration and use the `edgy.NEW_M2M_NAMING"`
or simply use a non-empty string for the `through_tablename` parameter.

0.26.1

Added

- Add PGArrayField.
- Add `build_and_save(...)` build variant to ModelFactory.
- Add `build(save=True)` to ModelFactory.

Changed

- Reorganize fields. Make more lazy.
- Make models, querysets imports in `__init__.py` lazy so circular dependency errors arise no more.
- Change in ModelFactory the default of `exclude_autoincrement` from `False` to `True`.
There is a strong demand in having save ready models.

0.26.0

Added

- `__drop_extra_kwargs__` parameter for Models which drops extra kwargs instead passing down. Required for mashalling StrictModel.
- `reference_select` parameter in QuerySet.
- `extra_select` parameter in QuerySet for creating extra select clauses which can be referenced.
- `ref_foreign_key_fields` in meta.

Changed

- Model allows now like ReflectModel arbitary arguments. Required for `reference_select`.
- Use a partly copied model as ProxyModel. This ensures that the logic of ReflectField still works.

Fixed

- Cleanup of event-loops and threads in run_sync.
- Fix running shell with auto reflected models.
- Fix `DatabaseNotConnectedWarning` in shell.
- Usage of StrictModels in Mashalls.
- Different autoincrement field in Marshalls than `id`.
- Fix Marshall required check.
- Fix ReflectModel with exclude_secrets.
- Fix non-edgy-fields were stripped instead kept.
- Allow ComputedFields being part of a serialization.

0.25.1

Added

- Add `exclude_autoincrement` parameter/class attribute to ModelFactory.
- Add `build_values` method to ModelFactory. It can be used to extract the values without a model.
- Make Registry initialization compatible with sync contexts via `with_async_env(loop=None)` method.
- `run_sync` has now an optional loop parameter.

Changed

- The Relation mappings doesn't set the autoincrement id anymore.
- Relationship fields of auto generated ModelFactories of ForeignKey, ... are now excluded when not parametrized.
This way large trees are avoided.
- Reduce the amount of generated related models to max 10 by default.
- Make `to_factory_field` and `to_list_factory_field` a method instead a classmethod.
Otherwise they are quite limited.
- `to_list_factory_field` honors the min and max parameter specified by parameters.
It defaults however to the provided min and max parameters.
- RefForeignKey has now an extra subclass of BaseField. This way the exclusion of works reliable.
- `run_sync` reuses idling loops.
- `run_sync` uses the loop set by the Registry contextmanager `with_async_env`.

Fixed

- ModelFactory was prone to run in infinite recursions.
- The RefForeignKey field was not working correctly.

0.25.0

Added

- Add `testing.factory.ModelFactory`.
- ManyToManyField `create_through_model` method allows now the keyword only argument `replace_related_field`.
- `add_to_registry` and models have now an additional keyword-only argument `on_conflict` for controlling what happens when a same named model already exists.
For models this can be passed : `class Foo(edgy.Model, on_conflict="keep"): ...`.
- Passing a tuple or list of types to `replace_related_field` is now allowed.
- Add `through_registry` to ManyToMany.
- Add `no_copy` to models MetaInfo.
- Add `ModelCollisionError` exception.
- Add keyword only hook function `real_add_to_registry`. It can be used to customize the `add_to_registry` behaviour.
- Add `__no_load_trigger_attrs__` to edgy base model to prevent some attrs from causing a deferred load.

Changed

- `create_edgy_model` has now `__type_kwargs__` which contains a dict of keyword arguments provided to `__new__` of type.
- RelatedField uses now `no_copy`.
- `add_to_registry` returns the type which was actually added to registry instead of None.
- Through models use now `no_copy` when autogenerated. This way they don't land in copied registries but are autogenerated again.
- Instead of silent replacing models with the same `__name__` now an error is raised.
- `skip_registry` has now also an allowed literal value: `"allow_search"`. It enables the search of the registry but doesn't register the model.
- Move `testclient` to `testing` but keep a forward reference.
- Change the default for ManyToMany `embed_through` from "" to `False` which affected traversing ManyToMany.
- Better protect secrets from leaking. Prevent load when accessing a secret field or column.

Fixed

- Copying registries and models is working now.
- Fix deleting (clearing cache) of BaseForeignKey target.
- Creating two models with the same name did lead to silent replacements.
- Invalidating caused schema errors.
- ManyToMany and ForeignKey fields didn't worked when referencing tenant models.
- ManyToMany fields didn't worked when specified on tenant models.
- Fix transaction method to work on instance and class.
- Fix missing file conversion in File. Move from ContentFile.
- Fix mypy crashing after the cache was build (cause ChoiceField annotation).
- Fix handling unknown fields via the generic_field.
- Sanify default for embed_through which affected traversing ManyToMany.
It defaulted to the backward compatible "" which requires the user to traverse the m2m model first.
- Prevent fully initialized models from triggering a deferred load.
- Prevent accessing excluded secrets from triggering a deferred load.

BREAKING

- Instead of silent replacing models with the same `__name__` now an error is raised.
- The return value of `add_to_registry` changed. If you customize the function you need to return now the actual model added to the registry.
- The default for ManyToMany `embed_through` changed from "" to `False` which affected traversing ManyToMany. For keeping the old behaviour pass:
`embed_through=""`.
- Accessing field values excluded by exclude_secrets doesn't trigger an implicit load anymore.

0.24.2

Fixed

- Try harder to avoid circular imports when providing settings with edgy references.

Page 1 of 9

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.