semvec/pypi-packages huggingface dataset:
fastapi-users-ormar-ext 0.1.2
Use ormar for your fastapi-users project.
License: MIT
Requires Python: >=3.9,<4.0

# fastapi-users-ormar-ext
Extension to use ormar in fastapi-users


# Installation

To install use:
```sh
pip install fastapi-users-ormar-ext
```

# Usage

Example:

```python
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