You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class SomePonyModel(BasePonyModel(table='table_name', database=db)):
name = Optional(str)
description = Optional(str)
...
The problem is that I cannot manage to get it working in a generic way so I could use the same base model for multiple models.
I tried overriding init and new, but I had no success doing it. Since I have multiple databases I have to pass in the db: Database object to make it work. If you have any clue how this can be done (if it can be done) please point me in the right direction. I think this "BasePonyModel" logic would help a lot of people to clean up their code.
The text was updated successfully, but these errors were encountered:
I tried the following and it only works for one model but if I use it on multiple models I get pony.orm.core.ERDiagramError: Entity BasePonyModel already exists
I have a project with many Pony Models where all of them share some fields:
I want to create a BasePonyModel like:
I would then use that Base model like:
The problem is that I cannot manage to get it working in a generic way so I could use the same base model for multiple models.
I tried overriding init and new, but I had no success doing it. Since I have multiple databases I have to pass in the
db: Database
object to make it work. If you have any clue how this can be done (if it can be done) please point me in the right direction. I think this "BasePonyModel" logic would help a lot of people to clean up their code.The text was updated successfully, but these errors were encountered: