author | rougeronj |
Thu, 16 Apr 2015 11:08:05 +0200 | |
changeset 150 | c8fe9606d967 |
parent 108 | 082b64a5c699 |
permissions | -rw-r--r-- |
24
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
# |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
# See LICENCE for detail |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright (c) 2014 IRI |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
# |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
|
26
ebfd0d3cffab
Correction on export_annotation. First working version
ymh <ymh.work@gmail.com>
parents:
24
diff
changeset
|
6 |
import sys |
ebfd0d3cffab
Correction on export_annotation. First working version
ymh <ymh.work@gmail.com>
parents:
24
diff
changeset
|
7 |
|
24
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
import flask.ext.restless |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
|
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
import database |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
import models |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
from webapp import app |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
|
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
manager = flask.ext.restless.APIManager(app, session=database.db_session) |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
|
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
manager.create_api(models.Annotation, |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
methods=['GET', 'POST', 'PUT', 'DELETE'], |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
url_prefix='/api/v1', |
eb1f7b06001f
add api + first version (not tested) of export annotation script
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
primary_key='uuid', |
26
ebfd0d3cffab
Correction on export_annotation. First working version
ymh <ymh.work@gmail.com>
parents:
24
diff
changeset
|
20 |
max_results_per_page=sys.maxint) |
108 | 21 |
|
22 |
manager.create_api(models.EventSession, |
|
23 |
methods=['GET'], |
|
24 |
url_prefix='/api/v1', |
|
25 |
primary_key='uuid', |
|
26 |
max_results_per_page=sys.maxint) |
|
27 |
||
28 |
manager.create_api(models.Event, |
|
29 |
methods=['GET'], |
|
30 |
url_prefix='/api/v1', |
|
31 |
primary_key='code', |
|
32 |
max_results_per_page=sys.maxint) |