Skip to content

Commit

Permalink
Committed automatically after model nr-documents has been compiled
Browse files Browse the repository at this point in the history
omb-00223-after-model-compile-nr-documents
  • Loading branch information
mesemus committed Dec 5, 2023
1 parent 3b7d0bb commit 91971ea
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion models/nr-documents/nr_documents/models/records.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"imports": []
},
"record": {
"extra-code": " # extra custom fields for sorting by title\n sort = {{nr_docs_extensions.services.sort.TitleICUSortField}}(source_field=\"metadata.title\")",
"extra-code": " # extra custom fields for sorting by title\n sort = {{nr_docs_extensions.services.sort.TitleICUSortField}}(source_field=\"metadata.title\")\n\n title_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.title\")\n creator_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.creators.fullName\")\n contributor_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.contributors.fullName\")\n abstract_search = {{oarepo_runtime.records.systemfields.icu.ICUSearchField}}(source_field=\"metadata.abstract.value\")",
"base-classes": [
"invenio_drafts_resources.records.api.Record{InvenioRecord}"
],
Expand Down
6 changes: 6 additions & 0 deletions models/nr-documents/nr_documents/records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from nr_docs_extensions.services.sort import TitleICUSortField
from oarepo_runtime.records.relations import PIDRelation, RelationsField
from oarepo_runtime.records.systemfields.has_draftcheck import HasDraftCheckField
from oarepo_runtime.records.systemfields.icu import ICUSearchField
from oarepo_runtime.records.systemfields.record_status import RecordStatusSystemField

from nr_documents.files.api import NrDocumentsFile, NrDocumentsFileDraft
Expand Down Expand Up @@ -57,6 +58,11 @@ class NrDocumentsRecord(InvenioRecord):
# extra custom fields for sorting by title
sort = TitleICUSortField(source_field="metadata.title")

title_search = ICUSearchField(source_field="metadata.title")
creator_search = ICUSearchField(source_field="metadata.creators.fullName")
contributor_search = ICUSearchField(source_field="metadata.contributors.fullName")
abstract_search = ICUSearchField(source_field="metadata.abstract.value")

relations = RelationsField(
accessRights=PIDRelation(
"metadata.accessRights",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"POT-Creation-Date: 2023-12-04T10:22:06.819037\n"
"PO-Revision-Date: 2023-12-04T10:22:06.819047\n"
"POT-Creation-Date: 2023-12-05T13:52:29.456931\n"
"PO-Revision-Date: 2023-12-05T13:52:29.456942\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"POT-Creation-Date: 2023-12-04T10:22:06.819069\n"
"PO-Revision-Date: 2023-12-04T10:22:06.819070\n"
"POT-Creation-Date: 2023-12-05T13:52:29.456966\n"
"PO-Revision-Date: 2023-12-05T13:52:29.456967\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
4 changes: 2 additions & 2 deletions models/nr-documents/nr_documents/translations/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"POT-Creation-Date: 2023-12-04T10:22:06.819085\n"
"PO-Revision-Date: 2023-12-04T10:22:06.819086\n"
"POT-Creation-Date: 2023-12-05T13:52:29.456984\n"
"PO-Revision-Date: 2023-12-05T13:52:29.456985\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down

0 comments on commit 91971ea

Please sign in to comment.