Skip to main content

Use ormar for your fastapi-users project.

Project description

fastapi-users-ormar-extension

Extension to use ormar in fastapi-users

Installation

To install use:

pip install fastapi-users-ormar-extension

Usage

Example:

from typing import Optional

import ormar

from fastapi_users_ormar_extension import (
    OrmarBaseUserTableUUID,
    OrmarBaseOAuthAccountTableUUID,
)


class BaseMeta(ormar.ModelMeta):
    """Base metadata for models."""

    database = database
    metadata = meta


class User(OrmarBaseUserTableUUID):
    class Meta(BaseMeta):
        pass

    phone: str = ormar.String(nullable=False, max_length=100)


class OAuthAccount(OrmarBaseOAuthAccountTableUUID):
    class Meta(BaseMeta):
        pass

    user: User = ormar.ForeignKey(User, nullable=False, ondelete="cascade")

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

fastapi_users_ormar_extension-0.3.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file fastapi_users_ormar_extension-0.3.0.tar.gz.

File metadata

File hashes

Hashes for fastapi_users_ormar_extension-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fd390ff7370fe5c70642e2c4b9c6f801f123054c1f15a82c757b743e54fae0ec
MD5 9d3e4638ce71aec90557e14c0ddc4973
BLAKE2b-256 68d44eee9145f6210808efd2ac1eedb159306ff805a3e7f14eeaa5ec01cd27e6

See more details on using hashes here.

File details

Details for the file fastapi_users_ormar_extension-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_users_ormar_extension-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccce468eb0f851ec62dbe836d57e410015527f56aa848714e748e21230749b9c
MD5 01b0af5b373f51567ee81659fef74b4a
BLAKE2b-256 a7ffcb0ff8523a2f577f2395ac810d00037aec7f7bdae05b4b7c2206138274f6

See more details on using hashes here.

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