[PonyORM-list] Trying to model friendships and getting ERDiagramError

Martin Frlin martin.frlin at gmail.com
Sun Oct 12 15:17:48 UTC 2014

Those are my models:

class User(db.Entity):
    name = PrimaryKey(str)

class Friendship(db.Entity):
    user1 = Required(User)
    user2 = Required(User)
    PrimaryKey(user1, user2)

when calling db.generate_mapping() I get this error:
pony.orm.core.ERDiagramError: Reverse attribute for Friendship.user1 not found

What am I doing wrong?

More information about the ponyorm-list mailing list