Commit 40d597980f0fb4772522d084f1b92eedd9123de6
1 parent
fbe3335a
Exists in
master
and in
39 other branches
Updating open-data
Showing
1 changed file
with
18 additions
and
8 deletions
Show diff stats
src/templates/open-data.html
@@ -17,31 +17,34 @@ | @@ -17,31 +17,34 @@ | ||
17 | <ul class="list-unstyled"> | 17 | <ul class="list-unstyled"> |
18 | <li> | 18 | <li> |
19 | <p>{% trans "Each model listed below has a resource_uri field available, which is the object's data URI." %}</p> | 19 | <p>{% trans "Each model listed below has a resource_uri field available, which is the object's data URI." %}</p> |
20 | - <p>{% trans "The following list contains the available models to retrieve data" %}:</p> | 20 | + <p>{% trans "The following list contains the available models to retrieve data and its fields available for filtering" %}:</p> |
21 | <ul> | 21 | <ul> |
22 | <li> | 22 | <li> |
23 | <strong><a href="{{ BASE_API_URL }}user/">user</a></strong>: | 23 | <strong><a href="{{ BASE_API_URL }}user/">user</a></strong>: |
24 | - {% trans "Retrieve users with username, institution, role, twitter, facebook, google talk, github, webpage and bio" %} | 24 | + {% trans "Fields" %}: <i>username, email, institution, role and bio</i> |
25 | + <p><strong>{% trans "The email field is not shown for user's privacy, but you can filter through it" %}</strong></p> | ||
25 | </li> | 26 | </li> |
26 | <li> | 27 | <li> |
27 | <strong><a href="{{ BASE_API_URL }}emailaddress/">emailaddress</a></strong>: | 28 | <strong><a href="{{ BASE_API_URL }}emailaddress/">emailaddress</a></strong>: |
28 | - {% trans "Retrieve emailaddress with user and real_name" %} | 29 | + {% trans "Fields" %}: <i>user, address and real_name</i> |
30 | + <p>{% trans "The user field is a foreign key for user objects and it can be null" %}</p> | ||
29 | </li> | 31 | </li> |
30 | <li> | 32 | <li> |
31 | <strong><a href="{{ BASE_API_URL }}message/">message</a></strong>: | 33 | <strong><a href="{{ BASE_API_URL }}message/">message</a></strong>: |
32 | - {% trans "Retrieve messages with body, id, received_time and subject" %} | 34 | + {% trans "Fields" %}: <i>from_address, body, id, received_time and subject</i> |
35 | + <p>{% trans "The from_address field is a foreign key to emailaddress objects" %}</p> | ||
33 | </li> | 36 | </li> |
34 | <li> | 37 | <li> |
35 | <strong><a href="{{ BASE_API_URL }}revision/">revision</a></strong>: | 38 | <strong><a href="{{ BASE_API_URL }}revision/">revision</a></strong>: |
36 | - {% trans "Retrieve revisions with author, created, key, message and repository_name" %} | 39 | + {% trans "Fields" %}: <i>author, created, key, message and repository_name</i> |
37 | </li> | 40 | </li> |
38 | <li> | 41 | <li> |
39 | <strong><a href="{{ BASE_API_URL }}ticket/">ticket</a></strong>: | 42 | <strong><a href="{{ BASE_API_URL }}ticket/">ticket</a></strong>: |
40 | - {% trans "Retrieve tickets with author, component, created, description, id, keywords, milestone, modified, modified_by, priority, reporter, severity, status, summary and version" %} | 43 | + {% trans "Fields" %}: <i>author, component, created, description, id, keywords, milestone, modified, modified_by, priority, reporter, severity, status, summary and version</i> |
41 | </li> | 44 | </li> |
42 | <li> | 45 | <li> |
43 | <strong><a href="{{ BASE_API_URL }}wiki/">wiki</a></strong>: | 46 | <strong><a href="{{ BASE_API_URL }}wiki/">wiki</a></strong>: |
44 | - {% trans "Retrieve wikis with author, created, modified, modified_by, name and wiki_text" %} | 47 | + {% trans "Fields" %}: <i>author, created, modified, modified_by, name and wiki_text</i> |
45 | </li> | 48 | </li> |
46 | </ul> | 49 | </ul> |
47 | </li> | 50 | </li> |
@@ -60,14 +63,21 @@ | @@ -60,14 +63,21 @@ | ||
60 | {% trans "Where n is the index of the first result to appear in the page." %} | 63 | {% trans "Where n is the index of the first result to appear in the page." %} |
61 | <i>{% trans "Default: 0" %}</i>. | 64 | <i>{% trans "Default: 0" %}</i>. |
62 | </li> | 65 | </li> |
66 | + <li class="divider"><h3>{% trans "Filtering" %}:</h3></li> | ||
63 | <li> | 67 | <li> |
64 | <h4><i>fieldname</i> - {% trans "The field name" %}</h4> | 68 | <h4><i>fieldname</i> - {% trans "The field name" %}</h4> |
65 | {% trans "If you are looking for a specific wiki, and you know the wiki's name, you can filter it as below" %} | 69 | {% trans "If you are looking for a specific wiki, and you know the wiki's name, you can filter it as below" %} |
66 | <p><i>...{{ BASE_API_URL }}wiki/?name={% trans "WikiName" %}</i></p> | 70 | <p><i>...{{ BASE_API_URL }}wiki/?name={% trans "WikiName" %}</i></p> |
67 | - {% trans "Where "name" is the fieldname and "WikiName" is the value you want to filter. You can also filter using Django lookup fields as below" %} | 71 | + <p>{% trans "Where "name" is the fieldname and "WikiName" is the value you want to filter." %}</p> |
72 | + <h4>{% trans "Usage" %}</h4> | ||
73 | + <p>{% trans "You can also filter using Django lookup fields as below" %}</p> | ||
68 | <p><i>...{{ BASE_API_URL }}wiki/?wiki_text__startswith={% trans "Wiki" %}</i></p> | 74 | <p><i>...{{ BASE_API_URL }}wiki/?wiki_text__startswith={% trans "Wiki" %}</i></p> |
69 | <p><i>...{{ BASE_API_URL }}ticket/?author__endswith={% trans "test" %}</i></p> | 75 | <p><i>...{{ BASE_API_URL }}ticket/?author__endswith={% trans "test" %}</i></p> |
70 | <p><i>...{{ BASE_API_URL }}message/?body__contains={% trans "test" %}</i></p> | 76 | <p><i>...{{ BASE_API_URL }}message/?body__contains={% trans "test" %}</i></p> |
77 | + <h4>{% trans "Usage with related models" %}</h4> | ||
78 | + <p><i>...{{ BASE_API_URL }}message/?from_address__user__email=usermailexample@host.com</i></p> | ||
79 | + <p><i>...{{ BASE_API_URL }}message/?from_address__real_name=Name</i></p> | ||
80 | + <p><strong>{% trans "Note: email filters must be exact." %} </strong></p> | ||
71 | </li> | 81 | </li> |
72 | </ul> | 82 | </ul> |
73 | </div> | 83 | </div> |