You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thank you for this awesome library. I have spent time but are not able to find a good solution to solving the create form, when the sqlaclhemy relationship is defined like this:
class Parent(Base):
__tablename__ = "parent"
id = Column(Integer, primary_key=True)
unique_identifier = Column(String, unique=True)
# Other fields...
class Child(Base):
__tablename__ = "child"
id = Column(Integer, primary_key=True)
parent_identifier = Column(String, ForeignKey("parent.unique_identifier"))
parent = relationship(
"Parent", primaryjoin="Parent.unique_identifier==Child.parent_identifier"
)
# Other fields...
I have tried to have a look at the QuerySelectField and it is always choosing the primary key of Parent as value. Is there any way to override this behaviour for it to rather choose in this instance unique_identifier. Will there be other steps also needed to make the inserts and edits work?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
First of all thank you for this awesome library. I have spent time but are not able to find a good solution to solving the create form, when the sqlaclhemy relationship is defined like this:
I have tried to have a look at the QuerySelectField and it is always choosing the primary key of Parent as value. Is there any way to override this behaviour for it to rather choose in this instance unique_identifier. Will there be other steps also needed to make the inserts and edits work?
Beta Was this translation helpful? Give feedback.
All reactions