-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes for oarepo-vocabularies and related fields (#50)
* Working on changes for vocabularies: 1. library-mode properties - used when a library is built, ignored when a library is used 2. read-only and dump-only schema properties * Extensions & changes for oarepo-vocabularies package * different loading of included schemas, changes for vocabularies * nr fixes * vocabulary changes * tests fixed, upgrade to importlib * 1.0.0dev8
- Loading branch information
Showing
34 changed files
with
348 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,4 +80,7 @@ example/data | |
test-model | ||
|
||
# Testing | ||
sample/ | ||
sample/ | ||
|
||
tests/test-sample-app | ||
tests/test-sample-site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
from .invenio_base import InvenioBaseClassPythonBuilder | ||
from ..builders import process | ||
|
||
|
||
class InvenioRecordBuilder(InvenioBaseClassPythonBuilder): | ||
TYPE = "invenio_record" | ||
class_config = "record-class" | ||
template = "record" | ||
|
||
def begin(self, schema, settings): | ||
super().begin(schema, settings) | ||
self.relations = [] | ||
|
||
@process("/model/**", condition=lambda current, stack: stack.schema_valid) | ||
def enter_model_element(self): | ||
self.build_children() | ||
data = self.stack.top.data | ||
if isinstance(data, dict) and 'invenio:relation' in data: | ||
self.relations.append(data['invenio:relation']) | ||
|
||
def process_template(self, python_path, template, **extra_kwargs): | ||
return super().process_template(python_path, template, **{ | ||
**extra_kwargs, | ||
'invenio_relations': self.relations | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.