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
Is there a way I can specify another field as my ForeignKey other than id
e.g
class Album(orm.Model):
id = orm.Integer(primary_key=True)
name = orm.String(max_length=100)
class Track(orm.Model):
album = orm.ForeignKey(Album.name)
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 there,
Is there a way I can specify another field as my ForeignKey other than id
e.g
Can I have the Album name as my foreign key?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions