fastcrud icon indicating copy to clipboard operation
fastcrud copied to clipboard

Add Relationship Support in Auto Generated Endpoints

Open neatek opened this issue 11 months ago • 3 comments

Does FastCRUD work with relationship in SQLAlchemy?

class Car(Base):
    brand_id = Column(Integer, ForeignKey("car_brands.id"), nullable=False)
    body_type_id = Column(Integer, ForeignKey("car_body_types.id"), nullable=False)
    body_type = relationship("CarBodyType", backref="cars")
    brand = relationship("CarBrand", backref="cars")

Description If you use get_multi, then a list is displayed without support for models that belong to this model

Additional context The expectation was that if you add a relationship to the SQLalchemy model, then this relationship will also appear in the list after get_multi

neatek avatar Mar 07 '24 06:03 neatek