Skip to main content

Pydantic models working with deta.space api, including ORM features.

Project description

ormspace

ORM modules powered by Pydantic for Deta Space.


Instructions

import datetime
import asyncio
from ormspace import model as md

@md.modelmap
class Person(md.Model):
    first_name: str 
    last_name: str 
    birth_date: datetime.date

@md.modelmap
class Patient(md.Model):
    person_key: Person.Key


async def main():
    await Patient.update_references_context()
    for item in await Patient.sorted_instances_list():
        print(item)

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ormspace-0.1.1.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

ormspace-0.1.1-py3-none-any.whl (12.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page