rodg

Results 6 comments of rodg

Yeah I just ran into this as well, going to +1 having the **option** to just raise the errors up. I get the point mentioned in other issues (like #66...

In the mean time this little hack seems to work (not exhaustively tested): ```python from typing import Callable, Any from fastapi_crudrouter import SQLAlchemyCRUDRouter as _SQLACRUDRouter from sqlalchemy.orm import Session from...

UserBase.company isn't a class constant so you won't be able to access it like that. As for the SQLModel part, [the docs mention not to inherit tables](https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/#only-inherit-from-data-models) (which I'm assuming...

Ok, so you'd want (and potentially need) to have the relationship on the table not the data model, so `User` would need to have that relationship. Your `UserRead` would then...

```python class UserBase(SQLModel): name: str class UserRead(UserBase): company: str = Field(..., alias="rank") @validator("company", pre=True) def get_rank(cls, company: CompanyUser) -> str: return company.rank class Config: allow_popoulation_by_field_name: True class User(UserBase, table=True): id:...

So this starts to get kind of janky, but you can get `HeroRead` to work. It does feel like a misuse of the validators though, so if there is a...