Skip to content

Commit

Permalink
service config components might be extra code, not only classes (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus authored Nov 1, 2023
1 parent 14711b2 commit 4deb8e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
{{ vars.marshmallow.class|imports }}
{{ vars.search_options.class|imports }}
{% for c in vars.service_config.components %}
{{ c|generate_import }}
{{ c|code_imports }}
{% endfor %}


class {{ vars.service_config|class_header }}:
"""{{ vars.record.class|base_name }} service config."""
PERMISSIONS_PRESETS = [{% for p in vars.permissions.presets %}"{{ p }}"{{ ", " if not loop.last else "" }} {% endfor %}]
Expand All @@ -30,7 +29,7 @@ class {{ vars.service_config|class_header }}:
service_id = "{{ vars.service_config.service_id }}"
{% endif %}

components = [ {% for b in vars.service_config.base_classes %}*{{ b|base_name }}.components{% if not loop.last %}, {% endif %}{% endfor %}{% for c in vars.service_config.components %}, {{ c|base_name }} {% endfor %}]
components = [ {% for b in vars.service_config.base_classes %}*{{ b|base_name }}.components{% if not loop.last %}, {% endif %}{% endfor %}{% for c in vars.service_config.components %}, {{ c|extra_code }} {% endfor %}]

model = "{{ vars.module.qualified }}"

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-model-builder
version = 4.0.62
version = 4.0.63
description = A utility library that generates OARepo required data model files from a JSON specification file
authors = Miroslav Bauer <[email protected]>, Miroslav Simek <[email protected]>
readme = README.md
Expand Down

0 comments on commit 4deb8e7

Please sign in to comment.