Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
5d125681
Commit
5d125681
authored
6 years ago
by
anonymous
Browse files
Options
Downloads
Patches
Plain Diff
fix problem with score if qa not present
parent
76f817da
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ckanext/odsh/helpers.py
+14
-9
14 additions, 9 deletions
ckanext/odsh/helpers.py
ckanext/odsh/templates/home/index.html
+0
-1
0 additions, 1 deletion
ckanext/odsh/templates/home/index.html
with
14 additions
and
10 deletions
ckanext/odsh/helpers.py
+
14
−
9
View file @
5d125681
...
@@ -8,9 +8,14 @@ log = logging.getLogger(__name__)
...
@@ -8,9 +8,14 @@ log = logging.getLogger(__name__)
def
odsh_openness_score_dataset_html
(
dataset
):
def
odsh_openness_score_dataset_html
(
dataset
):
score
=
0
score
=
0
#dataset = json.loads(dataset)
#dataset = json.loads(dataset)
for
resource
in
dataset
.
get
(
'
resources
'
):
resources
=
dataset
.
get
(
'
resources
'
)
if
resources
is
None
:
return
0
for
resource
in
resources
:
r_qa
=
resource
.
get
(
'
qa
'
)
if
r_qa
:
try
:
try
:
qa
=
ast
.
literal_eval
(
resource
.
get
(
'
qa
'
)
)
qa
=
ast
.
literal_eval
()
resource_score
=
qa
.
get
(
'
openness_score
'
)
resource_score
=
qa
.
get
(
'
openness_score
'
)
if
resource_score
>
score
:
if
resource_score
>
score
:
score
=
resource_score
score
=
resource_score
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/templates/home/index.html
deleted
100644 → 0
+
0
−
1
View file @
76f817da
{% ckan_extends %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment