Re: [PATCH v3 04/10] REST: Add Persons to the API

2016-05-20 Thread Andy Doan
On 05/19/2016 02:17 AM, Finucane, Stephen wrote: >On 18 May 22:30, Andy Doan wrote: This exports person objects via the REST API. Security Constraints: * The API is read-only to authenticated users > Question: we currently expose all users from 'api.py' for use by the > in Selectize auto-comp

Re: [PATCH v3 05/10] REST: Add Patches to the API

2016-05-20 Thread Andy Doan
On 05/19/2016 04:19 AM, Finucane, Stephen wrote: On 18 May 22:30, Andy Doan wrote: +class PatchListSerializer(ListSerializer): +'''Semi hack to make the list of patches more efficient''' +def to_representation(self, data): +del self.child.fields['content'] +del self.chi

Re: [PATCH v3 03/10] REST: Add Projects to the API

2016-05-20 Thread Andy Doan
On 05/19/2016 02:03 AM, Finucane, Stephen wrote: +page_size = settings.REST_RESULTS_PER_PAGE nit: This is already a DRF-provided setting that we can override: http://www.django-rest-framework.org/api-guide/settings/#page_size However, Given the deprecation of other similar parameters, I

Re: [PATCH v3 06/10] REST: Add Patch Checks to the API

2016-05-20 Thread Andy Doan
On 05/19/2016 04:26 AM, Finucane, Stephen wrote: +def test_create(self): >+"""Ensure creations can be performed by user of patch.""" >+check = { >+'state': 'success', >+'target_url': 'http://t.co', >+'description': 'description', >+

[PATCH v4 10/10] REST: Allow projects to be retrieved by linkname

2016-05-20 Thread Andy Doan
Building a user-friendly CLI becomes difficult when project-ids are required. It also makes it almost impossible to work with the current format of the .pwclientrc file. Signed-off-by: Andy Doan Reviewed-by: Stephen Finucane --- patchwork/tests/test_rest_api.py | 14 ++ patchwork/vi

[PATCH v4 09/10] REST API: expose patch.checks

2016-05-20 Thread Andy Doan
Signed-off-by: Andy Doan --- patchwork/rest_serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patchwork/rest_serializers.py b/patchwork/rest_serializers.py index 4fcd392..866cd86 100644 --- a/patchwork/rest_serializers.py +++ b/patchwork/rest_serializers.py @@ -66,6 +66,7 @@ cl

[PATCH v4 05/10] REST: Add Users to the API

2016-05-20 Thread Andy Doan
This exports user objects via the REST API. Security Constraints: * The API is read-only to authenticated users Signed-off-by: Andy Doan --- patchwork/rest_serializers.py| 8 patchwork/tests/test_rest_api.py | 41 patchwork/views/rest_api.

[PATCH v4 08/10] REST: Add Patch.mbox_url

2016-05-20 Thread Andy Doan
Provide a URL to the raw patch. Signed-off-by: Andy Doan Reviewed-by: Stephen Finucane --- patchwork/models.py | 4 patchwork/rest_serializers.py| 5 + patchwork/tests/test_rest_api.py | 1 + 3 files changed, 10 insertions(+) diff --git a/patchwork/models.py b/patchwo

[PATCH v4 07/10] REST: Add Patch Checks to the API

2016-05-20 Thread Andy Doan
This exports patch checks via the REST API. The drf-nested-routers package is used to handle the fact Checks are nested under a Patch. Security Constraints: * Anyone (logged in or not) can read all objects. * No one can update/delete objects. * Project maintainers and patch owners may create o

[PATCH v4 03/10] REST: Add Projects to the API

2016-05-20 Thread Andy Doan
This exports projects via the REST API. Security Constraints: * Anyone (logged in or not) can read all objects. * No one can create/delete objects. * Project maintainers are allowed to update (ie "patch" attributes) Signed-off-by: Andy Doan Inspired-by: Damien Lespiau Reviewed-by: Stephen

[PATCH v4 06/10] REST: Add Patches to the API

2016-05-20 Thread Andy Doan
This exposes patches via the REST API. Security Constraints: * Anyone (logged in or not) can read all objects. * No one can create/delete objects. * Project maintainers are allowed to update (ie "patch" attributes) NOTE: Patch.save was overridden incorrectly and had to be fixed to work with

[PATCH v4 04/10] REST: Add Persons to the API

2016-05-20 Thread Andy Doan
This exports person objects via the REST API. Security Constraints: * The API is read-only to authenticated users Signed-off-by: Andy Doan --- patchwork/rest_serializers.py| 13 +- patchwork/tests/test_rest_api.py | 54 patchwork/views/rest_

[PATCH v4 02/10] REST: Add base configuration hooks for a REST API

2016-05-20 Thread Andy Doan
This adds the ability to expose a REST API based on the Django REST framework project. Since this project isn't packaged in most current distributions, we ensure that its both installed and enabled before trying to use it. Signed-off-by: Andy Doan Inspired-by: Damien Lespiau Reviewed-by: Stephen

[PATCH v4 01/10] docs: Add prototype API specification

2016-05-20 Thread Andy Doan
From: Stephen Finucane Add specification for a REST API. It documents a number of endpoints for the following objects/models: * Projects * People * Patches * Checks The specification is provided in OpenAPI format [1]. This specification can be used to automatically generate REST client librarie

[PATCH v4 00/10] REST API support

2016-05-20 Thread Andy Doan
This patchset is inspired by the work done by Damien Lespiau. It creates a REST API based on the original spec RFC'd by Stephen Finucane. The only thing I know of that's missing from the patch set are bundles. I think over time the Series support will make them less important, but we could always t

Re: ./manage.py migrate not work

2016-05-20 Thread WEN Pingbo
Hi, Stephen 2016-05-20 17:07 GMT+08:00 Finucane, Stephen : > On 20 May 16:44, WEN Pingbo wrote: >> I want to install patchwork in my local environment, by following >> development guide doc. But when I run './manage.py migrate' command, >> the script complains that the 'patchwork_state' table not

Re: ./manage.py migrate not work

2016-05-20 Thread Finucane, Stephen
On 20 May 16:44, WEN Pingbo wrote: > Hello, folks > > I want to install patchwork in my local environment, by following > development guide doc. But when I run './manage.py migrate' command, > the script complains that the 'patchwork_state' table not found. And I > can not find the table definitio

./manage.py migrate not work

2016-05-20 Thread WEN Pingbo
Hello, folks I want to install patchwork in my local environment, by following development guide doc. But when I run './manage.py migrate' command, the script complains that the 'patchwork_state' table not found. And I can not find the table definition. Did I miss something? Here are the outputs