Skip to content
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

Create functionalty for extension points #16

Open
markoIvetic93 opened this issue Nov 18, 2017 · 2 comments
Open

Create functionalty for extension points #16

markoIvetic93 opened this issue Nov 18, 2017 · 2 comments
Assignees

Comments

@markoIvetic93
Copy link
Collaborator

No description provided.

@markoIvetic93 markoIvetic93 self-assigned this Nov 18, 2017
@markoIvetic93
Copy link
Collaborator Author

Short description of usage (and implementation):

  • Generated code calls functions, which are in another file (customs.py). Those functions are empty first, and user can put custom code there, and that file will not be overridden.

@sergiosuperstar
Copy link
Owner

Proposed changes for Django.Core:

  1. Create folder for custom functions. Proposed folder name: "model_extensions"
  2. Create custom functions file per model jinja template. Proposed generated file name: "{{ model_m }}_extensions.py"
  3. Create jinja template in "model_extensions" folder.
  4. {{model_m}} file content: python function or functions for model

Proposed changes for Generator:

  1. Update how createCustomFiles work by creating {{ model_m}}_extensions.py per model
  2. Move if file exist check from execute.py into createCustomFiles.py
  3. Update if file exit check so that it checks if file exist per model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants