Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PonyORM: Mapping is not generated for entity ‘User’

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.

like image 579
oskar_15 Avatar asked Feb 11 '26 16:02

oskar_15


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.

like image 150
eytaniva Avatar answered Feb 13 '26 04:02

eytaniva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!