one to one or one to many

eg Official website Code: `

// User 有一张 CreditCard,UserID 是外键 type User struct { gorm.Model CreditCard CreditCard } type CreditCard struct { gorm.Model Number string UserID uint } -- When I query from the user table, if I want to get the corresponding credit card information of the user, I can use the Preload() method to preload it to. But when I query through the credit card table, I want to get the corresponding user How can I find the ID of the user table associated with the credit card table? I can only find the corresponding ID, but can't find the corresponding ID of the user table. How can I get detailed information Is there a similar gorm django related_name or flask relationship (当我从用户表查询时,如果我想获取该用户对应的信用卡信息,我可以使用Preload()方法预加载到,但是当我通过信用卡表查询,想要获取到对应的用户 ,我该怎么查询到,因为信用卡表关联的用户表的id,我只能查到对应的id,无法查到用户表对应的id的详细信息,怎么才能获取到详细的信息,gorm是否存在类似django中的related_name 或者flask中的relationship来提供使用者反查)

`

Comment From: doudou-itachi

我的想法是gorm中存在一种django中的related_name 或者flask中的relationship,而不是我拿到从CreditCard 表查到UserID 后再去user表查询对应的详细信息

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking