PonyORM: Mapping is not generated for entity ‘User’

Viewed 802

I’m trying to learn and build small app with PonyOrm and Flask. For that I’ve copied example app from Pony’s GitHub. But I still get the same error:

pony.orm.core.ERDiagramError: Mapping is not generated for entity 'User'

I’ve been looking for answers on Google and in Pony documentation, to no avail.

1 Answers

Add this line after the creation of the entity and before you tries to map:

db.generate_mapping(create_tables=True) # create tables

Worked for me.

Related