Skip to content

Releases: collerek/ormar

Fix UUID foreign keys

11 Dec 12:38
Compare
Choose a tag to compare
Fix UUID foreign keys Pre-release
Pre-release

Fix issue #71

Fix unneeded related models overwrite in update

10 Dec 15:32
Compare
Choose a tag to compare

Fix issue #70

Fix saving model with related models

07 Dec 12:11
Compare
Choose a tag to compare
Pre-release

Fix for #68

Add Signals

06 Dec 19:07
380c2ab
Compare
Choose a tag to compare
Add Signals Pre-release
Pre-release
  • Breaking: QuerySet bulk_update method now raises ModelPersistenceError for unsaved models passed instead of QueryDefinitionError
  • Breaking: Model initialization with unknown field name now raises ModelError instead of KeyError
  • Added Signals, with pre-defined list signals and decorators: post_delete, post_save, post_update, pre_delete,
    pre_save, pre_update
  • Add py.typed and modify setup.py for mypy support
  • Performance optimization
  • Updated docs

Introduce property_field, bug fixes and performance optimization

04 Dec 14:24
1d4a074
Compare
Choose a tag to compare
  • Performance optimization
  • Fix for bug with pydantic_only fields being required
  • Add property_field decorator that registers a function as a property that will
    be included in Model.dict() and in fastapi response
  • Update docs

Fix setting default values on excluded fields

02 Dec 13:04
40254b9
Compare
Choose a tag to compare

Fix issue #60

Expose QuerysetProxy on reverse ForeignKey, add more QuerySet methods to QuerysetProxy

01 Dec 09:54
cbd793c
Compare
Choose a tag to compare
  • Breaking: calling instance.load() when the instance row was deleted from db now raises ormar.NoMatch instead of ValueError
  • Breaking: calling add and remove on ReverseForeignKey relation now updates the child model in db setting/removing fk column
  • Breaking: ReverseForeignKey relation now exposes QuerySetProxy API like ManyToMany relation
  • Breaking: querying related models from ManyToMany cleans list of related models loaded on parent model:
    • Example: post.categories.first() will set post.categories to list of 1 related model -> the one returned by first()
    • Example 2: if post has 4 categories so len(post.categories) == 4 calling post.categories.limit(2).all() -> will load only 2 children and now assert len(post.categories) == 2
  • Added get_or_create, update_or_create, fields, exclude_fields, exclude, prefetch_related and order_by to QuerySetProxy
    so now you can use those methods directly from relation
  • Update docs

Fix for alembic autogenaration of migration `UUID` columns

30 Nov 07:10
Compare
Choose a tag to compare
  • Fix for alembic autogenaration of migration UUID columns. It should just produce sqlalchemy CHAR(32) or CHAR(36)
  • In order for this to work you have to set user_module_prefix='sa.' (must be equal to sqlalchemy_module_prefix option (default 'sa.'))

Allow passing uuid_format to UUID field

28 Nov 10:32
98380a1
Compare
Choose a tag to compare
Pre-release
  • Allow to pass uuid_format (allowed 'hex'(default) or 'string') to UUID field to change the format in which it's saved.
    By default field is saved in hex format (trimmed to 32 chars (without dashes)), but you can pass
    format='string' to use 36 (with dashes) instead to adjust to existing db or other libraries.

    Sample:

    • hex value = c616ab438cce49dbbf4380d109251dce
    • string value = c616ab43-8cce-49db-bf43-80d109251dce

Fix dumping models to dict with include/exclude

27 Nov 18:14
0f102d3
Compare
Choose a tag to compare
Merge pull request #56 from collerek/fix_dict_dumping

Fix dict dumping of models with exclude/include set