Templates¶
The view will be added as an option with no further configuration necessary. However, if you wish to override or add content to the template, you can extend templates/graph/view.html:
{% ckan_extends %}
{% block my_new_block %}
<p>Look, some exciting new content.</p>
{% endblock %}
Extending¶
To use this extension with a datastore backend other than the ElasticSearch backend already implemented, you'll have to subclass from Query in ckanext-graph/ckanext/graph/db.py.
An unimplemented class for SQL queries is already in the file as an example:
class SqlQuery(Query):
@property
def _date_query(self):
raise NotImplementedError()
@property
def _count_query(self):
raise NotImplementedError()
def run(self):
raise NotImplementedError()
If you add a new class, you'll have to add it to the dictionary in Query.new() method to make it available as a configurable option.
If you do this, please submit a pull request! Contributions are always welcome.