Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mlachowski opened this issue Jan 23, 2024 · 1 comment
Open

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

mlachowski opened this issue Jan 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mlachowski
Copy link

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):

  • Starlette-Admin version: starlette-admin = {extras = ["i18n"], version = "^0.13.0"}
  • ORM/ODMs: sqlmodel = "^0.0.14"
@mlachowski mlachowski added the bug Something isn't working label Jan 23, 2024
@sglebs
Copy link

sglebs commented Jan 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants