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
怎么在only中指定select_related中表的字段
是否目前还未实现该功能
class A(Model):
id = fields.IntField(primary_key=True, description="ID")
name = fields.CharField(description="name", max_length=50)
class B(Model):
id = fields.IntField(primary_key=True, description="ID")
a = fields.ForeignKeyField("models.A", description="外键A", on_delete=fields.CASCADE)
eg:
await B.filter().select_related("a").only("id", "a__name") # just secelt B.id and A.name
Activity
CyanZoy commentedon Mar 5, 2025
the same question
Status: Open.
#916