-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Default Behavior to Create Model Example #190
Comments
It looks like cookiecutter doesn't provide us with any advanced prompt manipulation so I propose we set the default {
"codeowner_github_usernames": "",
"full_name": "Network to Code, LLC",
"email": "[email protected]",
"github_org": "nautobot",
"app_name": "my_app",
"verbose_name": "{{ cookiecutter.app_name.title().replace('_', ' ') }}",
"app_slug": "{{ cookiecutter.app_name.lower().replace(' ', '-').replace('_', '-') }}",
"project_slug": "nautobot-app-{{ cookiecutter.app_slug }}",
"repo_url": "https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}",
"base_url": "{{ cookiecutter.app_slug }}",
"min_nautobot_version": "2.0.0",
"max_nautobot_version": "2.9999",
"camel_name": "{{ cookiecutter.app_slug.title().replace(' ', '').replace('-', '') }}",
"project_short_description": "{{ cookiecutter.verbose_name }}",
"model_class_name": "{{ cookiecutter.camel_name }}ExampleModel",
"open_source_license": [
"Apache-2.0",
"Not open source"
],
"docs_base_url": "https://docs.nautobot.com",
"docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.app_slug }}/en/latest",
"__prompts__": {
"model_class_name": "Select the name of your first database model. Set to 'None' if this app will have no models."
}
} |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Provide the user the option to override the initial model name created but the current default behavior skips generating these files which then gets lost when managing drift as well as forces the user to manually create these files, often far adrift from standard.
cookiecutter-nautobot-app/nautobot-app/hooks/post_gen_project.py
Lines 27 to 48 in 566d869
To resolve the "missed when drift managed" issue in other Apps, update the
.cookiecutter.json
file in the repo to havemodel_class_name
be the name of one of the models in the App (ex:"model_class_name": "GoldenConfig"
for Golden Config). The value should be left as"None"
for any App that does not contain any models.The text was updated successfully, but these errors were encountered: