You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61-18
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# CKAN Data Requests [](https://travis-ci.org/conwetlab/ckanext-datarequests)
1
+
# CKAN Data Requests [](https://travis-ci.org/conwetlab/ckanext-datarequests)[](https://coveralls.io/github/conwetlab/ckanext-datarequests?branch=develop)
2
2
3
3
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.
4
4
@@ -25,7 +25,7 @@ On the other hand, you can also use the API. To access this API, you should POST
25
25
26
26
Here you have a brief description of all the implemented actions:
27
27
28
-
#### `datarequest_create(context, data_dict)`
28
+
#### `create_datarequest(context, data_dict)`
29
29
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.
30
30
31
31
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
36
36
***`organization_id`** (string): The ID of the organization you want to asign the data request (optional).
37
37
38
38
##### 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`).
40
40
41
41
42
-
#### `datarequest_show(context, data_dict)`
42
+
#### `show_datarequest(context, data_dict)`
43
43
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.
44
44
45
45
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
48
48
***`id`** (string): the ID of the datarequest to be returned.
49
49
50
50
##### 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`).
52
52
53
53
54
-
#### `datarequest_update(context, data_dict)`
54
+
#### `update_datarequest(context, data_dict)`
55
55
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
56
56
57
57
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
63
63
***`organization_id`** (string): The ID of the organization you want to asign the data request (optional).
64
64
65
65
##### 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`).
67
67
68
68
69
-
#### `datarequest_index(context, data_dict)`
69
+
#### `list_datarequests(context, data_dict)`
70
70
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
71
71
72
72
##### Parameters (included in `data_dict`):
@@ -82,28 +82,28 @@ Returns a list with the existing data requests. Rights access will be checked be
82
82
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)
83
83
84
84
85
-
#### `datarequest_delete(context, data_dict)`
85
+
#### `delete_datarequest(context, data_dict)`
86
86
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.
87
87
88
88
##### Parameters (included in `data_dict`):
89
89
***`id`** (string): the ID of the datarequest to be deleted
90
90
91
91
##### 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`).
93
93
94
94
95
-
#### `datarequest_close(context, data_dict)`
95
+
#### `close_datarequest(context, data_dict)`
96
96
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
97
97
98
98
##### Parameters (included in `data_dict`):
99
99
***`id`** (string): the ID of the datarequest to be closed
100
100
***`accepted_dataset`** (string): The ID of the dataset accepted as solution for the data request
101
101
102
102
##### 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`).
104
104
105
105
106
-
#### `datarequest_comment(context, data_dict)`
106
+
#### `comment_datarequest(context, data_dict)`
107
107
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
108
108
109
109
##### Parameters (included in `data_dict`):
@@ -114,7 +114,7 @@ Action to create a comment in a data request. Access rights will be checked befo
114
114
A dict with the data request comment (`id`, `user_id`, `datarequest_id`, `time` and `comment`)
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
119
119
120
120
##### Parameters (included in `data_dict`):
@@ -124,7 +124,7 @@ Action to retrieve a comment. Access rights will be checked before getting the c
124
124
A dict with the following fields: `id`, `user_id`, `datarequest_id`, `time` and `comment`
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
129
129
130
130
##### Parameters (included in `data_dict`):
@@ -135,7 +135,7 @@ Action to retrieve all the comments of a data request. Access rights will be che
135
135
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`
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
140
140
141
141
##### Parameters (included in `data_dict`):
@@ -146,7 +146,7 @@ Action to update a comment of a data request. Access rights will be checked befo
146
146
A dict with the data request comment (`id`, `user_id`, `datarequest_id`, `time` and `comment`)
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
151
151
152
152
##### Parameters (included in `data_dict`):
@@ -155,9 +155,30 @@ Action to delete a comment of a data request. Access rights will be checked befo
155
155
##### Returns:
156
156
A dict with the data request comment (`id`, `user_id`, `datarequest_id`, `time` and `comment`)
157
157
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
+
158
179
## Installation
159
180
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.
161
182
162
183
* Activate your virtual environment
163
184
```
@@ -223,8 +244,30 @@ python setup.py nosetests
223
244
```
224
245
**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`).
225
246
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
+
226
249
## Changelog
227
250
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.
0 commit comments