aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/api/views.py
Commit message (Collapse)AuthorAgeFilesLines
* Made api_test use @require_active_loginJoar Wandborg2013-01-021-3/+1
|
* prepare_queue_task: Take app not request.Elrond2012-12-261-2/+2
| | | | | | | | | First rename prepare_entry to prepare_queue_task, because this is really more like what this thing does. Thanks to Velmont for noting that we do not need a request in here, but an "app" is good enough. Which means, that this stuff can be called from tool scripts too.
* upload refactor: Use prepare_entry in api.Elrond2012-12-261-18/+2
|
* Use run_process_media in the api.Elrond2012-12-261-20/+2
| | | | Now refactor in the api. Start with run_process_media.
* Remove mongo style .id = ObjectId()Elrond2012-12-241-2/+0
| | | | | On SQL we can't generate the primary key on our own. So just remove this stuff.
* Mongo removal: Remove the validate=True arg to obj.save()Elrond2012-12-241-1/+1
| | | | | all callers were forced to use validate=True anyway. So remove this useless stuff.
* Convert return HttpException to raise HttpExceptionSebastian Spaeth2012-12-231-3/+3
| | | | | | controllers (view function) raise HttpException's and do not return them. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* replace webob.Response with werkzeug ResponseSebastian Spaeth2012-12-211-2/+4
| | | | | | | | | | | | Replace webob usage in one more file. Document a TODO that should be clarified, we should probably be using json_response rather than Response() here. Modify the TestMeddleware to not rely on the content_type attribute being present, while werkzeug.wrappers Response() has it the BaseResponse() object which is often returned in tests does not have it. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Transition webob.HttpForbidden to webob's exceptions ForbiddenSebastian Spaeth2012-12-211-4/+5
| | | | Also the BadRequest exception.
* Move DBModel._id -> DBModel.idSebastian Spaeth2012-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | We were refering to model._id in most of the code base as this is what Mongo uses. However, each use of _id required a) fixup of queries: e.g. what we did in our find() and find_one() functions moving all '_id' to 'id'. It also required using AliasFields to make the ._id attribute available. This all means lots of superfluous fixing and transitioning in a SQL world. It will also not work in the long run. Much newer code already refers to the objects by model.id (e.g. in the oauth plugin), which will break with Mongo. So let's be honest, rip out the _id mongoism and live with .id as the one canonical way to address objects. This commit modifies all users and providers of model._id to use model.id instead. This patch works with or without Mongo removed first, but will break Mongo usage (even more than before) I have not bothered to fixup db.mongo.* and db.sql.convert (which converts from Mongo to SQL) Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Replaced all request.POST with request.form, ...Joar Wandborg2012-09-291-15/+12
| | | | | - Fixed error handling in OAuth plugin - Changed request.POST file fields to request.files
* Added support for http callbacks on processingJoar Wandborg2012-09-261-0/+6
| | | | | Sends an HTTP POST request back to an URL given on submission to the API submit view.
* Fixed validation in API post_entry.Joar Wandborg2012-09-171-1/+10
| | | | Added state to API get_entry_serializable
* API: Fixed media file URLs, limitsJoar Wandborg2012-09-151-0/+7
| | | | | - Added default limit and limit arg to get_entries - Fixed URL generation for BasicFileStorage files in API
* Fixed ?next=<url> argument for require_active_loginJoar Wandborg2012-09-151-0/+2
| | | | It now includes the full URI, including GET args, not just the path.
* Fixed typo in API post_entryJoar Wandborg2012-09-151-1/+1
|
* Added post_entry at /api/submitJoar Wandborg2012-09-151-0/+91
|
* Added fields to /api/entries, wrote docstrings for api.toolsJoar Wandborg2012-09-151-1/+1
|
* Added /api/entries viewJoar Wandborg2012-09-151-1/+15
|
* Created API plugin, moved api_auth to the API pluginJoar Wandborg2012-09-131-0/+32