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
Currently, I've decided to use cookiecutter to generate code parts as well. Initially jinja2 was chosen, but it's another dependency and tool for users to learn. Even though at first glance it's easy to use, having complex multi-file templates might be more difficult to implement (and test). Cookiecutter on the other hand is already being used for new project generation, also should be more versatile and flexible when it comes to templating.
Some issues to consider:
Technically cookiecutter doesn't allow single file templates, so code generators will be sort of patches that will override/add to the current fastapi-mvc project directory. Not sure how this plays out.
It seems that after generation in template dir __init__.py empty files will be created (where they aren't) which can override __init__.py files already existing in the project directory that can have some logic inside. The easiest workaround could be via hooks - pre_gen_hook. However, I'm not sure if this issue is caused by cookiecuter or if I just messed something up. Will follow up on this later.
Feature Request
Add base implementation for controller generator (similar to Rails):
fastapi-mvc generate controller Comments
This would create:
comments.py
underpackage_name.app.models.controllers.v1
submoduleSimilar to #45
The text was updated successfully, but these errors were encountered: