Using mixin with the online Pony editor output

134 Views Asked by At

The Pony documentation suggests to use mixins in order to add methods to the classes automatically generated by the online editor.

The documentation shows the manually created mixins.py containing the custom methods and the automatically generated models.py containing the line class Product(db.Entity, ProductMixin):.

How do I tell the editor to automatically add , ProductMixin?

Adding it manually would defeat the purpose, because it would require to manually modify models.py in order to avoid manually modifying models.py.

Am I missing something?

1

There are 1 best solutions below

1
On BEST ANSWER

You are right, this feature is not supported by the editor yet.

At this point we are preparing the PonyORM release which will include the migration tool. Once we release it, the next thing we'll do is add the feature you're talking about to the editor. You'll be able to download a .zip file from the editor, which includes the Pony project files, such as models.py, mixins placeholder, database configuration file.

Thank you for your question.