improve date handling

This commit is contained in:
collerek
2021-07-06 15:11:26 +02:00
parent 69fffdd2e2
commit cb4e5ea955
9 changed files with 206 additions and 27 deletions

View File

@ -108,14 +108,18 @@ You can use either `length` and `precision` parameters or `max_digits` and `deci
### Time
`Time()` has no required parameters.
`Time(timezone: bool = False)` has no required parameters.
You can pass `timezone=True` for timezone aware database column.
* Sqlalchemy column: `sqlalchemy.Time`
* Type (used for pydantic): `datetime.time`
### DateTime
`DateTime()` has no required parameters.
`DateTime(timezone: bool = False)` has no required parameters.
You can pass `timezone=True` for timezone aware database column.
* Sqlalchemy column: `sqlalchemy.DateTime`
* Type (used for pydantic): `datetime.datetime`

View File

@ -44,6 +44,22 @@ pip install ormar[sqlite]
Will install also `aiosqlite`.
### Orjson
```py
pip install ormar[orjson]
```
Will install also `orjson` that is much faster than builtin json parser.
### Crypto
```py
pip install ormar[crypto]
```
Will install also `cryptography` that is required to work with encrypted columns.
### Manual installation of dependencies
Of course, you can also install these requirements manually with `pip install asyncpg` etc.

View File

@ -1,3 +1,15 @@
# 0.10.14
## ✨ Features
* Allow passing `timezone:bool = False` parameter to `DateTime` and `Time` fields for timezone aware database columns [#264](https://github.com/collerek/ormar/issues/264)
* Allow passing datetime, date and time for filter on `DateTime`, `Time` and `Date` fields to allow filtering by datetimes instead of converting the value to string [#79](https://github.com/collerek/ormar/issues/79)
## 🐛 Fixes
* Fix dependencies from `psycopg2` to `psycopg2-binary` [#255](https://github.com/collerek/ormar/issues/255)
# 0.10.13
## ✨ Features