Skip to content

Commit

Permalink
change version and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
smileservices committed Nov 25, 2020
1 parent 6954f9f commit b0ddd84
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 15 deletions.
Binary file modified dist/django-edit-suggestion-1.24.tar.gz
Binary file not shown.
Binary file added dist/django-edit-suggestion-1.25.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion django_edit_suggestion.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/usage.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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``

Expand Down
21 changes: 17 additions & 4 deletions docs/_build/html/_sources/usage.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/``
5 changes: 5 additions & 0 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ <h2>Github Repo<a class="headerlink" href="#github-repo" title="Permalink to thi
<div class="section" id="changes">
<h2>Changes<a class="headerlink" href="#changes" title="Permalink to this headline"></a></h2>
<dl class="simple">
<dt>1.25</dt><dd><ol class="arabic simple">
<li><p>add <code class="docutils literal notranslate"><span class="pre">edit_suggestion_publish</span></code> and <code class="docutils literal notranslate"><span class="pre">edit_suggestion_reject</span></code> to <code class="docutils literal notranslate"><span class="pre">ModelViewsetWithEditSuggestion</span></code> viewset</p></li>
<li><p>create tests for them</p></li>
</ol>
</dd>
<dt>1.24</dt><dd><ol class="arabic simple">
<li><p>add m2m support to <code class="docutils literal notranslate"><span class="pre">diff_against_parent</span></code></p></li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions docs/_build/html/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,18 @@ <h2>Django REST integration<a class="headerlink" href="#django-rest-integration"
</pre></div>
</div>
<p>It will add <code class="docutils literal notranslate"><span class="pre">edit_suggestions</span></code> for GET and <code class="docutils literal notranslate"><span class="pre">create_edit_suggestion</span></code> for POST requests.</p>
<p>Have <code class="docutils literal notranslate"><span class="pre">edit_suggestion_publish</span></code> and <code class="docutils literal notranslate"><span class="pre">edit_suggestion_reject</span></code> for POST requests.</p>
<p>Thus, to <strong>retrieve the edit suggestions</strong> for a specific resource using django rest we would send
a GET request to <code class="docutils literal notranslate"><span class="pre">reverse('parent-viewset-edit-suggestions',</span> <span class="pre">kwargs={'pk':</span> <span class="pre">1})</span></code></p>
<p>The url in string form would be <code class="docutils literal notranslate"><span class="pre">/api/parent/1/create_edit_suggestion/</span></code></p>
<p>To <strong>create</strong> an edit suggestion for a resource we will send a POST request to <code class="docutils literal notranslate"><span class="pre">reverse('parent-viewset-create-edit-suggestion',</span> <span class="pre">kwargs={'pk':</span> <span class="pre">1})</span></code>
The url in string form would be <code class="docutils literal notranslate"><span class="pre">/api/parent/1/edit_suggestions/</span></code></p>
a GET request to <code class="docutils literal notranslate"><span class="pre">reverse('parent-viewset-edit-suggestions',</span> <span class="pre">kwargs={'pk':</span> <span class="pre">1})</span></code>.</p>
<p>The url in string form would be <code class="docutils literal notranslate"><span class="pre">/api/parent/1/create_edit_suggestion/</span></code>.</p>
<p>To <strong>create</strong> an edit suggestion for a resource we will send a POST request
to <code class="docutils literal notranslate"><span class="pre">reverse('parent-viewset-create-edit-suggestion',</span> <span class="pre">kwargs={'pk':</span> <span class="pre">1})</span></code>
The url in string form would be <code class="docutils literal notranslate"><span class="pre">/api/parent/1/edit_suggestions/</span></code>.</p>
<p>To publish using the viewset send a POST request to <code class="docutils literal notranslate"><span class="pre">reverse('parent-viewset-edit-suggestion-publish',</span> <span class="pre">kwargs={'pk':</span> <span class="pre">1})</span></code>
with a json object having <code class="docutils literal notranslate"><span class="pre">edit_suggestion_id</span></code> key with the edit suggestion pk.</p>
<p>To reject using the viewset send a POST request to <code class="docutils literal notranslate"><span class="pre">reverse('parent-viewset-edit-suggestion-reject',</span> <span class="pre">kwargs={'pk':</span> <span class="pre">1})</span></code>
with a json object having <code class="docutils literal notranslate"><span class="pre">edit_suggestion_id</span></code> key with the edit suggestion pk and <code class="docutils literal notranslate"><span class="pre">edit_suggestion_reject_reason</span></code> as the reason for rejection.</p>
<p>The responses will return status 403 if the rule does not verify, 401 for another exception and 200 for success.</p>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``

Expand Down
21 changes: 17 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/``
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit b0ddd84

Please sign in to comment.