Is your feature request related to a problem? Please describe.
I'm connecting my Python application to Laravel, a web framework. Laravel generates its database tables with underscores, but Tortoise doesn't. I've looked through the documentation and was unable to find a solution. You could always specify the table in each model, but it'll get pretty annoying when you have hundreds of them.
Describe the solution you'd like
It would be awesome if we could pass a function to table in the Meta class. peewee has this functionality. Adopting something like this should make the ORM more compatible with outside sources.
Describe alternatives you've considered
I've tried the mentioned solution. Currently, I'm just explicitly setting the table in each of my models.
I agree. I specifically want snake_case_table_names, but in general, it would be nice to establish a base-class with a function for generating table-names from class names.
Is your feature request related to a problem? Please describe. I'm connecting my Python application to Laravel, a web framework. Laravel generates its database tables with underscores, but Tortoise doesn't. I've looked through the documentation and was unable to find a solution. You could always specify the table in each model, but it'll get pretty annoying when you have hundreds of them.
Describe the solution you'd like It would be awesome if we could pass a function to
table
in theMeta
class. peewee has this functionality. Adopting something like this should make the ORM more compatible with outside sources.Describe alternatives you've considered I've tried the mentioned solution. Currently, I'm just explicitly setting the table in each of my models.