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-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")
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_extension-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 418c1b0e812e5679acb06b4bc9211401e0ed8584f07327442c34a737e82dd4db |
|
MD5 | c85d14709d2f8f386927c2007b6dc29e |
|
BLAKE2b-256 | c697eb9438629c8c922446819a6c45be59a0e7c15ef4bcbd47464187f4e53c8d |
Close
Hashes for fastapi_users_ormar_extension-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e498bcea1d433b7463b4c5e304606aa60b587767a9358a19b3f93f276b8f0f2 |
|
MD5 | 86eb1dc5e7070753e996887f62bf154e |
|
BLAKE2b-256 | 2dadf779146f389744e4b10f516efe4d8a3b86d5ecae50474b0aa67ad9a35b39 |