I define a lot of model classes using peewee. ClassName.create_table()
can generate the table,but only one table. How could I create all tables using a single state
An update for Python 3 (and everyone who comes across this question via Google like I did). If you have all models based on the main peewee Model class you can simply use:
import peewee
models = peewee.Model.__subclasses__()
Credit to this question for the idea. They also go into more detail on how to get it to work recursively if your model is more complex.