Skip to content

Commit a6dfe99

Browse files
author
Aitor Magán García
committed
Merge branch 'develop' for release 1.0.0
2 parents 95f68bb + 40f68a8 commit a6dfe99

33 files changed

+1191
-442
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ before_script:
1919
- sleep 3 # give xvfb some time to start
2020
script:
2121
- sh bin/travis-run.sh
22+
after_success: coveralls
2223
branches:
2324
only:
24-
- develop
25+
- develop

README.md

+61-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CKAN Data Requests [![Build Status](https://travis-ci.org/conwetlab/ckanext-datarequests.svg?branch=develop)](https://travis-ci.org/conwetlab/ckanext-datarequests)
1+
# CKAN Data Requests [![Build Status](https://travis-ci.org/conwetlab/ckanext-datarequests.svg?branch=develop)](https://travis-ci.org/conwetlab/ckanext-datarequests) [![Coverage Status](https://coveralls.io/repos/github/conwetlab/ckanext-datarequests/badge.svg?branch=develop)](https://coveralls.io/github/conwetlab/ckanext-datarequests?branch=develop)
22

33
CKAN extension that allows users to ask for datasets that are not already published in the CKAN instance. In this way we can set up a Data Market, not only with data supplies but also with data demands.
44

@@ -25,7 +25,7 @@ On the other hand, you can also use the API. To access this API, you should POST
2525

2626
Here you have a brief description of all the implemented actions:
2727

28-
#### `datarequest_create(context, data_dict)`
28+
#### `create_datarequest(context, data_dict)`
2929
Action to create a new data request. This function checks the access rights of the user before creating the data request. If the user is not allowed, a `NotAuthorized` exception will be risen.
3030

3131
In addition, you should note that the parameters will be checked and an exception (`ValidationError`) will be risen if some of these parameters are not valid.
@@ -36,10 +36,10 @@ In addition, you should note that the parameters will be checked and an exceptio
3636
* **`organization_id`** (string): The ID of the organization you want to asign the data request (optional).
3737

3838
##### Returns:
39-
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`).
39+
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`, `followers`).
4040

4141

42-
#### `datarequest_show(context, data_dict)`
42+
#### `show_datarequest(context, data_dict)`
4343
Action to retrieve the information of a data request. The only required parameter is the `id` of the data request. A `NotFound` exception will be risen if the `id` is not found.
4444

4545
Access rights will be checked before returning the information and an exception will be risen (`NotAuthorized`) if the user is not authorized.
@@ -48,10 +48,10 @@ Access rights will be checked before returning the information and an exception
4848
* **`id`** (string): the ID of the datarequest to be returned.
4949

5050
##### Returns:
51-
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`).
51+
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`, `followers`).
5252

5353

54-
#### `datarequest_update(context, data_dict)`
54+
#### `update_datarequest(context, data_dict)`
5555
Action to update a data request. The function checks the access rights of the user before updating the data request. If the user is not allowed, a `NotAuthorized` exception will be risen
5656

5757
In addition, you should note that the parameters will be checked and an exception (`ValidationError`) will be risen if some of these parameters are not valid.
@@ -63,10 +63,10 @@ In addition, you should note that the parameters will be checked and an exceptio
6363
* **`organization_id`** (string): The ID of the organization you want to asign the data request (optional).
6464

6565
##### Returns:
66-
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`).
66+
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`, `followers`).
6767

6868

69-
#### `datarequest_index(context, data_dict)`
69+
#### `list_datarequests(context, data_dict)`
7070
Returns a list with the existing data requests. Rights access will be checked before returning the results. If the user is not allowed, a `NotAuthorized` exception will be risen
7171

7272
##### Parameters (included in `data_dict`):
@@ -82,28 +82,28 @@ Returns a list with the existing data requests. Rights access will be checked be
8282
A dict with three fields: `result` (a list of data requests), `facets` (a list of the facets that can be used) and `count` (the total number of existing data requests)
8383

8484

85-
#### `datarequest_delete(context, data_dict)`
85+
#### `delete_datarequest(context, data_dict)`
8686
Action to delete a new data request. The function checks the access rights of the user before deleting the data request. If the user is not allowed, a `NotAuthorized` exception will be risen.
8787

8888
##### Parameters (included in `data_dict`):
8989
* **`id`** (string): the ID of the datarequest to be deleted
9090

9191
##### Returns:
92-
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`).
92+
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`, `followers`).
9393

9494

95-
#### `datarequest_close(context, data_dict)`
95+
#### `close_datarequest(context, data_dict)`
9696
Action to close a data request. Access rights will be checked before closing the data request. If the user is not allowed, a `NotAuthorized` exception will be risen
9797

9898
##### Parameters (included in `data_dict`):
9999
* **`id`** (string): the ID of the datarequest to be closed
100100
* **`accepted_dataset`** (string): The ID of the dataset accepted as solution for the data request
101101

102102
##### Returns:
103-
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`).
103+
A dict with the data request (`id`, `user_id`, `title`, `description`,`organization_id`, `open_time`, `accepted_dataset`, `close_time`, `closed`, `followers`).
104104

105105

106-
#### `datarequest_comment(context, data_dict)`
106+
#### `comment_datarequest(context, data_dict)`
107107
Action to create a comment in a data request. Access rights will be checked before creating the comment and a `NotAuthorized` exception will be risen if the user is not allowed to create the comment
108108

109109
##### Parameters (included in `data_dict`):
@@ -114,7 +114,7 @@ Action to create a comment in a data request. Access rights will be checked befo
114114
A dict with the data request comment (`id`, `user_id`, `datarequest_id`, `time` and `comment`)
115115

116116

117-
#### `datarequest_comment_show(context, data_dict)`
117+
#### `show_datarequest_comment(context, data_dict)`
118118
Action to retrieve a comment. Access rights will be checked before getting the comment and a `NotAuthorized` exception will be risen if the user is not allowed to get the comment
119119

120120
##### Parameters (included in `data_dict`):
@@ -124,7 +124,7 @@ Action to retrieve a comment. Access rights will be checked before getting the c
124124
A dict with the following fields: `id`, `user_id`, `datarequest_id`, `time` and `comment`
125125

126126

127-
#### `datarequest_comment_list(context, data_dict)`
127+
#### `list_datarequest_comments(context, data_dict)`
128128
Action to retrieve all the comments of a data request. Access rights will be checked before getting the comments and a `NotAuthorized` exception will be risen if the user is not allowed to read the comments
129129

130130
##### Parameters (included in `data_dict`):
@@ -135,7 +135,7 @@ Action to retrieve all the comments of a data request. Access rights will be che
135135
A list with all the comments of a data request. Every comment is a dict with the following fields: `id`, `user_id`, `datarequest_id`, `time` and `comment`
136136

137137

138-
#### `datarequest_comment_update(context, data_dict)`
138+
#### `update_datarequest_comment(context, data_dict)`
139139
Action to update a comment of a data request. Access rights will be checked before updating the comment and a `NotAuthorized` exception will be risen if the user is not allowed to update the comment
140140

141141
##### Parameters (included in `data_dict`):
@@ -146,7 +146,7 @@ Action to update a comment of a data request. Access rights will be checked befo
146146
A dict with the data request comment (`id`, `user_id`, `datarequest_id`, `time` and `comment`)
147147

148148

149-
#### `datarequest_comment_delete(context, data_dict)`
149+
#### `delete_datarequest_comment(context, data_dict)`
150150
Action to delete a comment of a data request. Access rights will be checked before deleting the comment and a `NotAuthorized` exception will be risen if the user is not allowed to delete the comment
151151

152152
##### Parameters (included in `data_dict`):
@@ -155,9 +155,30 @@ Action to delete a comment of a data request. Access rights will be checked befo
155155
##### Returns:
156156
A dict with the data request comment (`id`, `user_id`, `datarequest_id`, `time` and `comment`)
157157

158+
#### `follow_datarequest(context, data_dict)`
159+
160+
Action to follow a data request. Access rights will be cheked before following a datarequest and a `NotAuthorized` exception will be risen if the user is not allowed to follow the given datarequest. `ValidationError` will be risen if the datarequest ID is not included or if the user is already following the datarequest. `ObjectNotFound` will be risen if the given datarequest does not exist.
161+
162+
##### Parameters (included in `data_dict`):
163+
* **`id`** (string): The ID of the datarequest to be followed
164+
165+
##### Returns:
166+
`True`
167+
168+
#### `unfollow_datarequest(context, data_dict)`
169+
170+
Action to unfollow a data request. Access rights will be cheked before unfollowing a datarequest and a NotAuthorized exception will be risen if the user is not allowed to unfollow the given datarequest. `ValidationError` will be risen if the datarequest ID is not included in the request. `ObjectNotFound` will be risen if the user is not following the given datarequest.
171+
172+
##### Parameters (included in `data_dict`):
173+
* **`id`** (string): The ID of the datarequest to be unfollowed
174+
175+
##### Returns:
176+
`True`
177+
178+
158179
## Installation
159180

160-
Install this extension in your CKAN instance is as easy as intall any other CKAN extension.
181+
Install this extension in your CKAN instance is as easy as install any other CKAN extension.
161182

162183
* Activate your virtual environment
163184
```
@@ -223,8 +244,30 @@ python setup.py nosetests
223244
```
224245
**Note:** The `test.ini` file contains a link to the CKAN `test-core.ini` file. You will need to change that link to the real path of the file in your system (generally `/usr/lib/ckan/default/src/ckan/test-core.ini`).
225246
247+
**Note 2:** When creating a PR that includes code changes, please, ensure your new code is tested. No PR will be merged until the Travis CI system marks it as valid.
248+
226249
## Changelog
227250
251+
### v1.0.0
252+
253+
* New: Option to follow data requests.
254+
* New: Email notifications:
255+
* An email will be sent to organization staff when a data request is created in a organization.
256+
* An email will be sent to followers, people that commented, datarequest creator and organization staff when a comment in a datarequest is created.
257+
* An email will be sent to followers, people that commented, datarequest creator and organization staff when a data request is closed.
258+
* New: Major API changes:
259+
* `datarequest_create` :arrow_right: `create_datarequest`
260+
* `datarequest_show` :arrow_right: `show_datarequest`
261+
* `datarequest_update` :arrow_right: `update_datarequest`
262+
* `datarequest_index` :arrow_right: `list_datarequests`
263+
* `datarequest_delete` :arrow_right: `delete_datarequest`
264+
* `datarequest_close` :arrow_right: `close_datarequest`
265+
* `datarequest_comment` :arrow_right: `comment_datarequest`
266+
* `datarequest_comment_show` :arrow_right: `show_datarequest_comment`
267+
* `datarequest_comment_list` :arrow_right: `list_datarequest_comments`
268+
* `datarequest_comment_update` :arrow_right: `update_datarequest_comment`
269+
* `datarequest_comment_delete` :arrow_right: `delete_datarequest_comment`
270+
228271
### v0.4.1
229272
230273
* New: Brazilian Portuguese (thanks to @allysonbarros)

0 commit comments

Comments
 (0)