Releases: ormar-orm/ormar
Releases · ormar-orm/ormar
Add multi columns non unique index and sql_nullable property. Important performance boost with relation map.
0.10.19
✨ Features
- Add support for multi-column non-unique
IndexColumnsinMeta.constraints#307 - Add
sql_nullablefield attribute that allows to set different nullable setting for pydantic model and for underlying sql column #308
🐛 Fixes
- Enable caching of relation map to increase performance #337
- Clarify and fix documentation in regard of nullable fields #339
💬 Other
- Bump supported
databasesversion to<=5.2.
Bug fixes
Add overwrite for pydantic field, support sqlalchemy >=1.4
SmallInterger field type, ability to pass own pydantic config
0.10.16
✨ Features
- Allow passing your own pydantic
Configtoormar.Modelthat will be merged with the default one by @naturalethic (thanks!) #285 - Add
SmallIntegerfield type by @ProgrammerPlus1998 (thanks!) #297
🐛 Fixes
Bug fixes
Improve dates handling and postgres dependencies
0.10.14
✨ Features
- Allow passing
timezone:bool = Falseparameter toDateTimeandTimefields for timezone aware database columns #264 - Allow passing
datetime,dateandtimefor filter onDateTime,TimeandDatefields to allow filtering by datetimes instead of converting the filter value to string #79
🐛 Fixes
- Fix dependencies from
psycopg2topsycopg2-binary#255
Fix inherited pk and add field accessor access to relations
0.10.13
✨ Features
- Allow passing field accessors in
select_relatedandprefetch_relatedaka. python styleselect_related#225.- Previously:
await Post.objects.select_related(["author", "categories"]).get() await Author.objects.prefetch_related("posts__categories").get()
- Now also:
await Post.objects.select_related([Post.author, Post.categories]).get() await Author.objects.prefetch_related(Author.posts.categories).get()
🐛 Fixes
- Fix overwriting default value for inherited primary key #253
Bug fixes
Get raw data with values and values_list
0.10.11
✨ Features
- Add
valuesandvalues_listtoQuerySetandQuerysetProxythat allows to return raw data from query #223.- Allow returning list of tuples or list of dictionaries from a query
- Skips parsing the data to ormar model so skips also the validation
- Allow excluding models in between in chain of relations, so you can extract only needed columns
values_listallows you to flatten the result if you extract only one column.
🐛 Fixes
- Fix creation of auto through model for m2m relation with ForwardRef #226
Generating pydantic models tree and exclude_parent_fields
0.10.10
✨ Features
- Add
get_pydanticfunction that allows you to auto generate equivalent pydantic models tree from ormar.Model. This newly generated model tree can be used in requests and responses to exclude fields you do not want to include in the data. - Add
exclude_parent_fieldsparameter to model Meta that allows you to exclude fields from parent models during inheritance. Note that best practice is to combine models and mixins but if you have many similar models and just one that differs it might be useful tool to achieve that.
🐛 Fixes
- Fix is null filter with pagination and relations (by @erichaydel) #214
- Fix not saving child object on reverse side of the relation if not saved before #216
💬 Other
- Expand fastapi part of the documentation to show samples of using ormar in requests and responses in fastapi.
- Improve the docs in regard of
default,ForeignKey.addetc.