from fastapi import Form
from pydantic import BaseModel


class LoginModel(BaseModel):
    username: str
    password: str

    @classmethod
    def as_form(
        cls,
        ctrl_username: str = Form(),
        ctrl_password: str = Form()
    ):
        return cls(username=ctrl_username, password=ctrl_password)
