Releases: rickh94/ODetaM
v1.5.1
v1.5.0 Change missing field behavior
No longer sets missing fields to None
, rather allows pydantic to handle the default behavior.
v1.4.0 Add get_or_none and improve typing
This release adds a get_or_none method to get possibly null values without producing an error. It also adds lots of type hints to make development easier and more consistent.
v1.3.2 - Switch to builtin Deta async
The addition of async support in the official deta python sdk has allowed us to switch to that and remove a dependency. This was possible because of the work done here #7, thank you!
This also fixes bug #5 in #6, and another I found where the get methods could be passed None and wouldn't complain. This now raises since a primary key of None
is obviously nonsense.
This also adds automated testing for python versions 3.10 and 3.11.
This release is also available on PyPi, which is obviously the best way to install.
Full Changelog: v1.2.0...v1.3.2
Add Async Support and integration tests
I've added async support! The api is basically the same, with a different import and async/await in your functions. It also requires aiodeta. Just pip install odetam aiodeta
then from odetam.async_model import AsyncDetaModel
.
Change Date/Datetime/Time serialization
-
Change datetime serialization behavior
I have rewritten most of the serialization code to better handle datetimes.
Unfornately, Deta does not have a built-in datetime type, so I hacked in some
serialization that provides useful functionality. Previously, they were simply
serialized to strings by pydantic's json serializer. Now dates, datetimes, and
times are turned into numbers so that the usual number queries (as well as range)
can be used. Previously, querying dates did not work at all.This change completely breaks compatibility with previous datetime fields.
Data saved before 1.1.0 will create errors when serialized. Either pin to
v1.0.5 (the latest version before this change) or update data. Models without
date/datetime/time fields are not affected.
Update to Deta 1.0
The core Deta library has gone to v1.0 and introduced a few improvements
(breaking changes). The behavior of fetch and query is now more logical,
returning a FetchResponse object that handles the pagination elegantly
and has a .items that just contains the items returned. I've updated
to handle this behavior so this functionality works correctly.
Note: ODetaM is NOT handling the pagination yet, so Bases larger than
1000 records will break the get_all() method. This is also true if
a query returns more than 1000 results. For now I would recommend
writing more specific queries, but I hope to get this implemented at
some point.
I recommend updating to Deta v1.0 and ODetaM v1.0.5.