Andrew
Andrew

Reputation: 147

Purpose of module grouping in Tortoise ORM

What is the purpose of specifying multiple module names in Tortoise ORM? Every time I use this library I have to specify not only the list of file paths to discover models from but also I am required to group them by using dictionary and assigning name to it

async def main():
    await Tortoise.init(
        db_url="sqlite://db.sqlite",
        modules={"discord": ["database"]},  # <- here
        timezone="Europe/Moscow"
    )
    await Tortoise.generate_schemas(safe=True)
    ...

What are the cases where we would actually need to have this functionality in our project?
Personally, I cannot think of any

Upvotes: 1

Views: 34

Answers (0)

Related Questions