-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Developed searchable community feature (and minor fixes listed below) (…
…#38) * changed widget class * added searchable community feature * fixed column headers * switched date and software type
- Loading branch information
Showing
6 changed files
with
134 additions
and
36 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
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
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,11 +1,21 @@ | ||
from eossr.api.zenodo import search_records | ||
from eossr.api.zenodo import search_records, search_communities | ||
|
||
async def searchRecords(search_field): | ||
async def searchRecords(search_field, page): | ||
try: | ||
records = search_records(search=search_field, size= 50) | ||
records = search_records(search=search_field, size= 50, page = page) | ||
response = [] | ||
for record in records: | ||
response.append({'id': record.id, 'title': record.title, 'date': record.metadata['publication_date'], 'resource_type': record.metadata['resource_type']['title']}) | ||
return response | ||
except: | ||
return ["failed"] | ||
|
||
async def searchCommunities(search_field): | ||
try: | ||
communities = search_communities(search=search_field, size= 50) | ||
response = [] | ||
for community in communities: | ||
response.append({'id': community['id'], 'title': community['metadata']['title'], 'date': community['created'].split('T')[0]}) | ||
return response | ||
except: | ||
return ["failed"] |