Skip to content

Releases: codemation/pydbantic

0.0.16

02 Dec 21:05
ea29810
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.0.15...0.0.16

0.0.15 - Filter operators and pagination

02 Dec 14:53
70a6214
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.0.14...0.0.15

0.0.14

23 Nov 22:23
21bc696
Compare
Choose a tag to compare

What's Changed

  • Fix/Enhancement - Improved db connection context manager by @codemation in #15

Full Changelog: 0.0.13...0.0.14

Migration Improvement - multi app same db support

22 Nov 12:32
Compare
Choose a tag to compare

Whats changed?

Multi App same DB support & Improvement Migrations - replaced complete TableMeta lookups during compare_tables_and_migrate with tables in self.tables, thus allowing the same database to be used accross multiple applications that do not share model definitions.

0.0.12 - Field Support for Arrays of Foreign DataBaseModel - Fixed MySQL

17 Nov 23:04
Compare
Choose a tag to compare
  • Fixed SqlAlchemy Column Type selection preventing foreign model usage with arrays in MySQL

0.0.11 - Field Support for Arrays of Foreign DataBase Models

17 Nov 17:02
eab0c57
Compare
Choose a tag to compare
  • Improved support for foreign model updates, .save() will invoke creation of foreign objects if not existing,
  • Added support for Arrays of Foreign References where a single field in a DataBaseModel may contain a list of other DataBaseModel objects
from uuid import uuid4
from datetime import datetime
from typing import List, Optional
from pydbantic import DataBaseModel, PrimaryKey


def time_now():
    return datetime.now().isoformat()
def get_uuid4():
    return str(uuid4())

class Coordinate(DataBaseModel):
    time: str = PrimaryKey(default=time_now)
    latitude: float
    longitude: float

class Journey(DataBaseModel):
    trip_id: str = PrimaryKey(default=get_uuid4)
    waypoints: List[Optional[Coordinate]]