-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
search: USI data searchable #21
Conversation
sonar/modules/documents/api.py
Outdated
@@ -40,13 +50,13 @@ class DocumentRecord(SonarRecord): | |||
@classmethod | |||
def create(cls, data, id_=None, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this method
"type": "string" | ||
}, | ||
"organization": { | ||
"description": "Organization the author belongs to.", | ||
"key": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to PID
@@ -31,6 +31,9 @@ | |||
<div class="row"> | |||
<div class="col-12 col-sm-11"> | |||
<input class="form-control form-control-lg mr-2" type="search" placeholder="{{_('Search publications, authors, projects, ...')}}" aria-label="Search" name="q"> | |||
{% if g.ir|default('sonar') != 'sonar' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explore invenio search UI --> search_hidden_params
sonar/modules/documents/cli.py
Outdated
""" | ||
url = current_app.config.get('SONAR_DOCUMENTS_RERO_DOC_URL') | ||
|
||
click.secho('Importing {} pages of records for "{}" from {}'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use named arguments for formats
sonar/modules/documents/cli.py
Outdated
(current_page*10-9), (current_page*10)), nl=False) | ||
|
||
# Read Marc21 data for current page | ||
response = requests.get(url + '?of=xm&jrec={}&c=NAVSITE.{}'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add URL placeholder to format
Pipfile
Outdated
@@ -30,6 +30,7 @@ pytest-mock = ">=1.6.0" | |||
pytest-pep8 = ">=1.0.6" | |||
pytest-random-order = ">=0.5.4" | |||
pytest-runner = ">=3.0.0,<5" | |||
pylint = "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove pylint dependency
data/institutions.json
Outdated
[ | ||
{ | ||
"name": "Università della Svizzera italiana", | ||
"key": "usi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use pid instead of key
sonar/modules/ext.py
Outdated
@@ -24,12 +24,10 @@ def __init__(self, app=None): | |||
def init_app(self, app): | |||
"""Flask application initialization.""" | |||
self.init_config(app) | |||
app.extensions['sonar'] = self | |||
app.extensions['sonar_modules'] = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to sonar_app
sonar/modules/ext.py
Outdated
for k in dir(config): | ||
if k.startswith('SONAR_'): | ||
if k.startswith('SONAR_MODULES_'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to SONAR_APP_
sonar/modules/institutions/ext.py
Outdated
@@ -22,15 +22,15 @@ def __init__(self, app=None): | |||
def init_app(self, app): | |||
"""Flask application initialization.""" | |||
self.init_config(app) | |||
app.extensions['sonar-authors'] = self | |||
app.extensions['sonar_institutions'] = self | |||
|
|||
def init_config(self, app): | |||
"""Initialize configuration. | |||
|
|||
Override configuration variables with the values in this package. | |||
""" | |||
# for k in dir(config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused configuration
sonar/modules/institutions/api.py
Outdated
schema = 'institution' | ||
|
||
@classmethod | ||
def get_item_by_key(cls, key): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method will be removed as key will not exist anymore
@jma I've done the changes we discussed. You can check |
"default": "https://sonar.ch/schemas/institutions/institution-v1.0.0.json" | ||
}, | ||
"pid": { | ||
"description": "Institution identifier.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use title instead of description same above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I corrected the titles and descriptions
NEW Import fixtures from RERO doc. NEW Filter search by contextual IR (USI). BETTER Increase code coverage. Signed-off-by: Sébastien Délèze <sebastien.deleze@rero.ch>
NEW Import fixtures from RERO doc.
NEW Filter search by contextual IR (USI).
Signed-off-by: Sébastien Délèze sebastien.deleze@rero.ch