Use ormar for your fastapi-users project.
Project description
fastapi-users-ormar-ext
Extension to use ormar in fastapi-users
Installation
To install use:
pip install fastapi-users-ormar-ext
Usage
Example:
from typing import Optional
import ormar
from fastapi_users_ormar_ext 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")
TODO
[ ] Think of a way to force user
field overriding in OrmarBaseOAuthAccountTableUUID
[ ] Add tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi-users-ormar-ext-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af1c2570298c589f8e2ed82caf0f5036d7ad922bb2d4d7291dba952fb35d40a8 |
|
MD5 | 38bcdf59598d80ddcda42e72d332a863 |
|
BLAKE2b-256 | 85edbe7864941daac63abe8d018d0e457db7359adc44cb8988b3cee4541440b2 |
Close
Hashes for fastapi_users_ormar_ext-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9813b4311a5a8acfc0392de9656e5a0deca26d35626ab91c889f10d543b42fef |
|
MD5 | 34cb2d16a8bbd6c145f4cd00a7448769 |
|
BLAKE2b-256 | c8f2d89a4762e278e306901bf22377d173aba92f7ac895cfa3a62df1a185948f |