Replies: 1 comment 2 replies
-
Hi @mciszczon It is better to write a Otherwise, you will lose the features of JOIN and etc. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there!
Sorry for a nooby question, I guess I lack the proper knowledge about SQLAlchemy and Ormar, but I am struggling with one thing. I want to create a one to many relationship on my ormar models, but not using the default primary key/ID fields.
My use case is like this:
The thing is that the
Relation.user
field maps toUser.username
field, but I am unable to create a relationship between these two models usingormar.ForeignKey
. Is that even possible? Didn't find anything in the documentation, nor in discussions/issues.Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions