diff --git a/dist/django-edit-suggestion-1.24.tar.gz b/dist/django-edit-suggestion-1.24.tar.gz index 271a047..b2fdd63 100644 Binary files a/dist/django-edit-suggestion-1.24.tar.gz and b/dist/django-edit-suggestion-1.24.tar.gz differ diff --git a/dist/django-edit-suggestion-1.25.tar.gz b/dist/django-edit-suggestion-1.25.tar.gz new file mode 100644 index 0000000..7123f8d Binary files /dev/null and b/dist/django-edit-suggestion-1.25.tar.gz differ diff --git a/django_edit_suggestion.egg-info/PKG-INFO b/django_edit_suggestion.egg-info/PKG-INFO index 7692862..1a6c8e1 100644 --- a/django_edit_suggestion.egg-info/PKG-INFO +++ b/django_edit_suggestion.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-edit-suggestion -Version: 1.24 +Version: 1.25 Summary: A django package for creating multiple users editable models Home-page: https://github.com/smileservices/django-edit-suggestion Author: Vladimir Gorea diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 057b83a..538e07c 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 45a3f55..4ccba2d 100644 Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ diff --git a/docs/_build/doctrees/usage.doctree b/docs/_build/doctrees/usage.doctree index 3cfba52..9e8cefc 100644 Binary files a/docs/_build/doctrees/usage.doctree and b/docs/_build/doctrees/usage.doctree differ diff --git a/docs/_build/html/_sources/index.rst.txt b/docs/_build/html/_sources/index.rst.txt index b26c933..3030849 100644 --- a/docs/_build/html/_sources/index.rst.txt +++ b/docs/_build/html/_sources/index.rst.txt @@ -27,6 +27,10 @@ https://github.com/smileservices/django-edit-suggestion Changes ~~~~~~~ +1.25 + #. add ``edit_suggestion_publish`` and ``edit_suggestion_reject`` to ``ModelViewsetWithEditSuggestion`` viewset + #. create tests for them + 1.24 #. add m2m support to ``diff_against_parent`` diff --git a/docs/_build/html/_sources/usage.rst.txt b/docs/_build/html/_sources/usage.rst.txt index 1953e81..825a844 100644 --- a/docs/_build/html/_sources/usage.rst.txt +++ b/docs/_build/html/_sources/usage.rst.txt @@ -170,6 +170,8 @@ The ModelViewsetWithEditSuggestion is to be inherited from when creating the mod It will add ``edit_suggestions`` for GET and ``create_edit_suggestion`` for POST requests. +Have ``edit_suggestion_publish`` and ``edit_suggestion_reject`` for POST requests. + .. code-block:: python # urls.py from rest_framework.routers import DefaultRouter @@ -184,9 +186,20 @@ It will add ``edit_suggestions`` for GET and ``create_edit_suggestion`` for POST ] Thus, to **retrieve the edit suggestions** for a specific resource using django rest we would send -a GET request to ``reverse('parent-viewset-edit-suggestions', kwargs={'pk': 1})`` +a GET request to ``reverse('parent-viewset-edit-suggestions', kwargs={'pk': 1})``. + +The url in string form would be ``/api/parent/1/create_edit_suggestion/``. + +To **create** an edit suggestion for a resource we will send a POST request +to ``reverse('parent-viewset-create-edit-suggestion', kwargs={'pk': 1})`` +The url in string form would be ``/api/parent/1/edit_suggestions/``. + + +To publish using the viewset send a POST request to ``reverse('parent-viewset-edit-suggestion-publish', kwargs={'pk': 1})`` +with a json object having ``edit_suggestion_id`` key with the edit suggestion pk. + +To reject using the viewset send a POST request to ``reverse('parent-viewset-edit-suggestion-reject', kwargs={'pk': 1})`` +with a json object having ``edit_suggestion_id`` key with the edit suggestion pk and ``edit_suggestion_reject_reason`` as the reason for rejection. -The url in string form would be ``/api/parent/1/create_edit_suggestion/`` +The responses will return status 403 if the rule does not verify, 401 for another exception and 200 for success. -To **create** an edit suggestion for a resource we will send a POST request to ``reverse('parent-viewset-create-edit-suggestion', kwargs={'pk': 1})`` -The url in string form would be ``/api/parent/1/edit_suggestions/`` diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html index 0400a21..1e5951e 100644 --- a/docs/_build/html/index.html +++ b/docs/_build/html/index.html @@ -185,6 +185,11 @@
add edit_suggestion_publish
and edit_suggestion_reject
to ModelViewsetWithEditSuggestion
viewset
create tests for them
add m2m support to diff_against_parent
It will add edit_suggestions
for GET and create_edit_suggestion
for POST requests.
Have edit_suggestion_publish
and edit_suggestion_reject
for POST requests.
Thus, to retrieve the edit suggestions for a specific resource using django rest we would send
-a GET request to reverse('parent-viewset-edit-suggestions', kwargs={'pk': 1})
The url in string form would be /api/parent/1/create_edit_suggestion/
To create an edit suggestion for a resource we will send a POST request to reverse('parent-viewset-create-edit-suggestion', kwargs={'pk': 1})
-The url in string form would be /api/parent/1/edit_suggestions/
reverse('parent-viewset-edit-suggestions', kwargs={'pk': 1})
.
+The url in string form would be /api/parent/1/create_edit_suggestion/
.
To create an edit suggestion for a resource we will send a POST request
+to reverse('parent-viewset-create-edit-suggestion', kwargs={'pk': 1})
+The url in string form would be /api/parent/1/edit_suggestions/
.
To publish using the viewset send a POST request to reverse('parent-viewset-edit-suggestion-publish', kwargs={'pk': 1})
+with a json object having edit_suggestion_id
key with the edit suggestion pk.
To reject using the viewset send a POST request to reverse('parent-viewset-edit-suggestion-reject', kwargs={'pk': 1})
+with a json object having edit_suggestion_id
key with the edit suggestion pk and edit_suggestion_reject_reason
as the reason for rejection.
The responses will return status 403 if the rule does not verify, 401 for another exception and 200 for success.
diff --git a/docs/index.rst b/docs/index.rst index b26c933..3030849 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,6 +27,10 @@ https://github.com/smileservices/django-edit-suggestion Changes ~~~~~~~ +1.25 + #. add ``edit_suggestion_publish`` and ``edit_suggestion_reject`` to ``ModelViewsetWithEditSuggestion`` viewset + #. create tests for them + 1.24 #. add m2m support to ``diff_against_parent`` diff --git a/docs/usage.rst b/docs/usage.rst index 1953e81..825a844 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -170,6 +170,8 @@ The ModelViewsetWithEditSuggestion is to be inherited from when creating the mod It will add ``edit_suggestions`` for GET and ``create_edit_suggestion`` for POST requests. +Have ``edit_suggestion_publish`` and ``edit_suggestion_reject`` for POST requests. + .. code-block:: python # urls.py from rest_framework.routers import DefaultRouter @@ -184,9 +186,20 @@ It will add ``edit_suggestions`` for GET and ``create_edit_suggestion`` for POST ] Thus, to **retrieve the edit suggestions** for a specific resource using django rest we would send -a GET request to ``reverse('parent-viewset-edit-suggestions', kwargs={'pk': 1})`` +a GET request to ``reverse('parent-viewset-edit-suggestions', kwargs={'pk': 1})``. + +The url in string form would be ``/api/parent/1/create_edit_suggestion/``. + +To **create** an edit suggestion for a resource we will send a POST request +to ``reverse('parent-viewset-create-edit-suggestion', kwargs={'pk': 1})`` +The url in string form would be ``/api/parent/1/edit_suggestions/``. + + +To publish using the viewset send a POST request to ``reverse('parent-viewset-edit-suggestion-publish', kwargs={'pk': 1})`` +with a json object having ``edit_suggestion_id`` key with the edit suggestion pk. + +To reject using the viewset send a POST request to ``reverse('parent-viewset-edit-suggestion-reject', kwargs={'pk': 1})`` +with a json object having ``edit_suggestion_id`` key with the edit suggestion pk and ``edit_suggestion_reject_reason`` as the reason for rejection. -The url in string form would be ``/api/parent/1/create_edit_suggestion/`` +The responses will return status 403 if the rule does not verify, 401 for another exception and 200 for success. -To **create** an edit suggestion for a resource we will send a POST request to ``reverse('parent-viewset-create-edit-suggestion', kwargs={'pk': 1})`` -The url in string form would be ``/api/parent/1/edit_suggestions/`` diff --git a/setup.py b/setup.py index d663aa9..ff7f831 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='django-edit-suggestion', - version='1.24', + version='1.25', description='A django package for creating multiple users editable models', url='https://github.com/smileservices/django-edit-suggestion', author='Vladimir Gorea',