-
Notifications
You must be signed in to change notification settings - Fork 31
Open
@rustamovjavohir
Description
class Company(UUIDBaseModel):
tablename = "companies"
name = Column(String(250), nullable=False)
parent_id: Optional[str] = Column(BigInteger, ForeignKey("companies.id", ondelete="SET NULL"), nullable=True)
# Relationships
parent = relationship("Company", remote_side="Company.id", back_populates="children")
children = relationship("Company", back_populates="parent", cascade="all, delete-orphan")
If I set nullable=True for the ForeignKey, it still shows required=True in the admin panel. Do I need to write additional configuration for this?
Metadata
Metadata
Assignees
Labels
No labels