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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
c55f18ef
Commit
c55f18ef
authored
6 years ago
by
anonymous
Browse files
Options
Downloads
Patches
Plain Diff
ODPSH-383
parent
be827f70
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ckanext/odsh/plugin.py
+28
-0
28 additions, 0 deletions
ckanext/odsh/plugin.py
ckanext/odsh/templates/snippets/facet_list.html
+1
-1
1 addition, 1 deletion
ckanext/odsh/templates/snippets/facet_list.html
with
29 additions
and
1 deletion
ckanext/odsh/plugin.py
+
28
−
0
View file @
c55f18ef
...
...
@@ -22,8 +22,35 @@ import logging
import
validation
import
precondition
import
sys
log
=
logging
.
getLogger
(
__name__
)
# from functools import wraps
# from flask import Flask, redirect, jsonify
# app = Flask(__name__)
# def get_http_exception_handler(app):
# """Overrides the default http exception handler to return JSON."""
# handle_http_exception = app.handle_http_exception
# @wraps(handle_http_exception)
# def ret_val(exception):
# print("HEHREHR")
# exc = handle_http_exception(exception)
# return jsonify({'code':exc.code, 'message':exc.description}), exc.code
# return ret_val
# # Override the HTTP exception handler.
# app.handle_http_exception = get_http_exception_handler(app)
# def my_except_hook(exctype, value, traceback):
# print('GOT excepton')
# log.exception(value)
# sys.__excepthook__(exctype, value, traceback)
# print('INSTALL EX')
# sys.excepthook = my_except_hook
_
=
toolkit
.
_
from
multiline_formatter.formatter
import
MultilineMessagesFormatter
...
...
@@ -354,6 +381,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
# use several daterange queries agains temporal_start and temporal_end field
# TODO: use field of type date_range in solr index instead
def
before_search
(
self
,
search_params
):
search_params
[
'
facet.mincount
'
]
=
0
extras
=
search_params
.
get
(
'
extras
'
)
if
not
extras
:
# There are no extras in the search params, so do nothing.
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/templates/snippets/facet_list.html
+
1
−
1
View file @
c55f18ef
...
...
@@ -7,7 +7,7 @@
{% block facet_list_items %}
{# {% with items = items or h.get_facet_items_dict(name,20) %} #}
{% with items = items or h.odsh_get_facet_items_dict(name) %}
{% with items = items or h.odsh_get_facet_items_dict(name)
|selectattr('count')|list
%}
{% if items %}
<nav>
{% set title = title or h.get_facet_title(name) %}
...
...
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