Skip to content

Commit

Permalink
Merge pull request #7 from GSA/Release-1.20
Browse files Browse the repository at this point in the history
Release 1.20
  • Loading branch information
Yatin Khadilkar committed Jul 1, 2014
2 parents 5d8dff8 + e659704 commit cfb80c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion ckanext/datajson/build_datajson.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ def make_datajson_entry(package):
extras = dict([(x['key'], x['value']) for x in package['extras']])

retlist = []
#if resource format is CSV then convert it to text/csv
#Resource format has to be in 'csv' format for automatic datastore push.
for r in package["resources"]:
if r["format"].lower() == "csv":
r["format"] = "text/csv"

try:
retlist = [
("title", package["title"]), #required
("description", package["notes"]), #required
("keyword", [t["display_name"] for t in package["tags"]]),#required
("modified", package["metadata_modified"]), #required
#("modified", package["metadata_modified"]), #required
("modified", extras.get("modified", package["metadata_modified"])), #required
("publisher", extras.get('publisher', package['author'])), #required
('contactPoint', extras['contact_name']), #required
('mbox', extras['contact_email']), #required
Expand Down
2 changes: 1 addition & 1 deletion ckanext/datajson/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def write_zip(data, error=None, zip_name='data'):

#Write the data file
if data:
zf.writestr('datajson.txt', json.dumps(data, ensure_ascii=False).encode('utf8'))
zf.writestr('data.json', json.dumps(data, ensure_ascii=False).encode('utf8'))

#Write the error log
if error:
Expand Down
4 changes: 2 additions & 2 deletions ckanext/datajson/templates/organization/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% if h.check_access('package_create', {'organization_id': c.group_dict.id}) %}
{% link_for _('Add Dataset'), controller='package', action='new', group=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
<button id="btnEdi" class="btn btn-secondary">Enterprise Data Inventory</button>
{% endif %}
<button id="btnPdl" class="btn btn-secondary">Public Data Listing</button>
<button id="btnPdl" class="btn btn-secondary">Public Data Listing</button>
{% endif %}

<form id="formEdi" action="{{c.group_dict.id + '/edi.json' }}"></form>
<form id="formPdl" action="{{c.group_dict.id + '/data.json' }}"></form>
Expand Down

0 comments on commit cfb80c6

Please sign in to comment.