-
Notifications
You must be signed in to change notification settings - Fork 45
tutorial 11: no such command 'records'. #74
Comments
|
* blocker: `pipenv run invenio records` was removed from `invenio-records` reform STEP 5 - markdown lint - ES7 mappings - child of inveniosoftware#50 * Added warning (addresses inveniosoftware#74).
* blocker: `pipenv run invenio records` was removed from `invenio-records` reform STEP 5 - markdown lint - ES7 mappings - child of inveniosoftware#50 * Added warning (addresses inveniosoftware#74).
* blocker: `pipenv run invenio records` was removed from `invenio-records` reform STEP 5 - markdown lint - ES7 mappings - child of inveniosoftware#50 * Added warning (addresses inveniosoftware#74).
How exactly do the loaders need to be changed? Is it it just the Presumably there's also something that needs doing to the deposit form to find and link the authors? |
Further investigation reveals that searching for I looked into that further, and the author reference does get resolved when access via REST, but marshmallow removes it, I guess because it's not in I've been looking at Is this the expected behaviour? |
I think I have something working, I'm just not sure if it's sensible: modified my_site/records/config.py
@@ -66,6 +66,7 @@ RECORDS_UI_ENDPOINTS = dict(
route='/records/<pid_value>',
template='records/record.html',
record_class='invenio_records_files.api:Record',
+ view_imp="my_site.records.views:record_view",
),
recid_previewer=dict(
pid_type='recid',
modified my_site/records/marshmallow/json.py
@@ -63,6 +63,7 @@ class MetadataSchemaV1(StrictKeysMixin):
publication_date = DateString()
contributors = Nested(ContributorSchemaV1, many=True, required=True)
owner = fields.Integer()
+ author = fields.Dict()
_schema = GenFunction(
attribute="$schema",
data_key="$schema",
modified my_site/records/views.py
@@ -12,6 +12,7 @@ from os.path import splitext
from flask import Blueprint
from invenio_previewer.proxies import current_previewer
+from invenio_records_ui.views import default_view_method
blueprint = Blueprint(
'my_site_records',
@@ -46,3 +47,6 @@ def select_preview_file(files):
except KeyError:
pass
return selected
+
+def record_view(pid, record, template=None, **kwargs):
+ return default_view_method(pid, record.replace_refs(), template, **kwargs) Instead of using The other half is to add a custom view that just calls the default view but passes If this seems like a sensible solution, I'd be happy to make a PR adding this to the tutorial. If not, I'd really appreciate some pointers on how to fix this properly! |
Problem
Tutorial 11 relies on creating records with references using the
invenio records
CLI. However, Invenio-Records CLI has been remove in version 1.3.0.Solution
Modify tutorial to enable the creation of linked records through the REST API.
The text was updated successfully, but these errors were encountered: