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
File details
Details for the file fastapi_users_ormar_ext-0.1.2.tar.gz
.
File metadata
- Download URL: fastapi_users_ormar_ext-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.18 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b53e2771c066006efde8a7a12d5fad1ac42a9ca25d3addfccba529f917e76e26 |
|
MD5 | 31b3945e854aa19d7d3960885d0bed68 |
|
BLAKE2b-256 | 06005bb9f62c2c8618209c4664c8adfa047d26abdc240d1a783becc6f1f9e63d |
File details
Details for the file fastapi_users_ormar_ext-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: fastapi_users_ormar_ext-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.9.18 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5533d5a5a6709c8a56b2e428e38ef564cc4ec8be4e670b78b787eef1a4d831c |
|
MD5 | bd4c80486ec8f5868de1aa75b6e8b6ba |
|
BLAKE2b-256 | 01d131799d9a3a6eb42165af076f60d52e94651cf924ff720d4dc697883b5be7 |