Skip to content

Commit

Permalink
copying record fields to included data
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Krist committed Aug 26, 2024
1 parent 0797270 commit 5ec0327
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions oarepo_model_builder/loaders/extend.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def extract_extended_record(included_data, *, context, **kwargs):
"properties": extended_object.get("properties", {}),
}

def add_record_to_included_data(included_data, *, context, **kwargs):
if "props" in context and "record" in context["props"]:
included_data["record"] = context["props"]["record"]
return included_data


def extend_modify_marshmallow(included_data, *, context, **kwargs):
"""
Expand Down
3 changes: 2 additions & 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.88
version = 4.0.89
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 Expand Up @@ -171,6 +171,7 @@ oarepo_model_builder.builders.base =

oarepo_model_builder.loaders.extend =
0100-extract_record = oarepo_model_builder.loaders.extend:extract_extended_record
0200-add_record_to_included_data = oarepo_model_builder.loaders.extend:add_record_to_included_data
1000-modify-marshmallow = oarepo_model_builder.loaders.extend:extend_modify_marshmallow

oarepo_model_builder.loaders.post.extend =
Expand Down

0 comments on commit 5ec0327

Please sign in to comment.