Merge lp://staging/~mhall119/ubuntu-accomplishments-web/add-json-service into lp://staging/ubuntu-accomplishments-web
Proposed by
Michael Hall
Status: | Merged |
---|---|
Merged at revision: | 162 |
Proposed branch: | lp://staging/~mhall119/ubuntu-accomplishments-web/add-json-service |
Merge into: | lp://staging/ubuntu-accomplishments-web |
Diff against target: |
291 lines (+260/-0) 5 files modified
services/__init__.py (+6/-0) services/handler.py (+161/-0) services/urls.py (+15/-0) services/views.py (+77/-0) urls.py (+1/-0) |
To merge this branch: | bzr merge lp://staging/~mhall119/ubuntu-accomplishments-web/add-json-service |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-accomplishments-web-editor-drivers | Pending | ||
Review via email: mp+110575@code.staging.launchpad.net |
Commit message
Add basic REST/JSON service for accomplishments and user trophies
Description of the change
Adds a /api/ base path with the following JSON services:
/api/user/[id] returns users.models.
/api/accomplish
/api/collection
/api/category/[id] returns common.
/api/icon/[id] returns common.models.Icon data
All of the above, when not using an id, can be filtered using ?field=value in the URL
/api/trophies/
To post a comment you must log in.
Very nice, I have some comments/questions:
* if an entity is not found (wrong id in the url) wouldn't it be better to return a 404 status code?
* the same for the unsupported operations (the api could return a 501 Not Implemented, 400 Bad Request, 403 Forbidden, or something like that)
* I would remove the code not relevant to the web gallery (room, agenda, participant, crew, etc)
my two cents