Declaring an entity
Each entity belongs to a database. That is why before defining entities you need to create an object of the Database
class:
from pony.orm import *
db = Database()
class MyEntity(db.Entity):
attr1 = Required(str)
The Pony’s Database object has the Entity
attribute which is used as a base class for all the entities stored in this database. Each new entity that is defined must inherit from this Entity
class.