我有类别和子类别,我想用父类别填充父类。我应该怎么做?
class Category(Base):
__tablename__ = 'category'
id = Column(UUIDType, primary_key=True)
organisation_id = Column(UUIDType)
category_name = Column(String(50))
parent_category_id = Column(UUIDType, ForeignKey("category.id"))
parent_category = relationship("Category", backref='category',
remote_side=parent_category_id)