jowilf / starlette-admin

Fast, beautiful and extensible administrative interface framework for Starlette & FastApi applications
https://jowilf.github.io/starlette-admin/
MIT License
546 stars 57 forks source link

Bug: required relationship field is not marked as required #486

Open mlachowski opened 6 months ago

mlachowski commented 6 months ago

Describe the bug

Required relationship field is not marked as required (as for example "Name" is marked).

image

To Reproduce Create simple model and view with following fields:

class Company(SQLModel, table=True):
    id: int = Field(default=None, primary_key=True)
    name: str 
    facilities: List["Facility"] = Relationship(back_populates="company")

class Facility(SQLModel, table=True):
    id: int = Field(default=None, primary_key=True)
    name: str
    company_id: int = Field(foreign_key="company.id")
    company: Company = Relationship(back_populates="facilities")

company_view = ModelView(Company)
facility_view = ModelView(Facility)

Environment (please complete the following information):

sglebs commented 6 months ago

I don't get any of these mandatory markers, even for simple fields. But I use SQLAlchemy. Is it possible to have it?