Many-to-many relationship

In order to create many-to-many relationship you need to define both ends of the relationship as Set attributes:

  1. class Product(db.Entity):
  2. tags = Set("Tag")
  3. class Tag(db.Entity):
  4. products = Set(Product)

In order to implement this relationship in the database, Pony will create an intermediate table. This is a well known solution which allows you to have many-to-many relationships in relational databases.