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 @@

Github Repo

ChangesΒΆ

+
1.25
    +
  1. add edit_suggestion_publish and edit_suggestion_reject to ModelViewsetWithEditSuggestion viewset

  2. +
  3. create tests for them

  4. +
+
1.24
  1. add m2m support to diff_against_parent

diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 513f132..43f263b 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["index","install","usage"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","install.rst","usage.rst"],objects:{},objnames:{},objtypes:{},terms:{"126":2,"boolean":2,"class":2,"default":2,"new":0,"return":2,"true":2,For:2,The:[0,2],abl:2,access:2,actual:2,add:[0,1,2],adding:0,admin:0,after:2,against:0,anymor:2,api:2,app:2,attach:2,attribut:2,auth:2,author:[0,2],base:2,being:2,between:2,build:2,can:[0,2],chang:2,change_status_condit:2,changed_field:2,charfield:2,check:2,children:2,com:0,come:2,condit:[0,2],condition_check:2,content:0,contrib:2,creat:0,create_edit_suggest:2,curent:2,current:2,customus:2,databas:0,def:2,delet:2,diff:0,diff_against_par:[0,2],differ:2,django:1,django_edit_suggest:1,django_rest:0,doe:2,dure:2,each:2,edit:1,edit_data:2,edit_suggest:2,edit_suggestion_author:2,edit_suggestion_inst:2,edit_suggestion_publish:2,edit_suggestion_reason:2,edit_suggestion_reject:2,editsuggest:2,editsuggestionparentmodel:2,editsuggestionseri:[0,2],empti:2,enabl:0,exampl:0,except:2,excluded_field:2,fals:2,field:0,form:2,from:[1,2],get:2,get_edit_suggestion_seri:2,has:2,have:[0,1,2],how:0,http:0,inherit:2,initi:2,insid:2,instal:0,installed_app:1,instanc:[0,2],instanti:2,integerfield:2,integr:0,invok:2,is_superus:2,just:2,kwarg:2,list:0,lock:2,m2m:0,m2m_field:2,m2m_type_field:2,m2mselfmodel:2,mani:2,manytomanyfield:2,max_length:2,meta:2,method:2,model:0,modeldelta:2,modelseri:2,modelviewsetwitheditsuggest:[0,2],modifi:2,modul:2,name:2,need:2,new_record:2,object:2,old_record:2,option:2,other:0,packag:0,parent:0,parent_model_inst:2,parenteditseri:2,parentmodel:2,parentmodelinst:2,parentseri:2,parentviewset:2,pass:[0,2],permissiondeni:2,phase:2,pip:1,post:2,product:0,publish:0,pypi:1,queryset:2,rais:2,reason:2,receiv:2,refer:2,referenc:2,reject:0,relat:2,request:2,requir:1,resourc:[0,2],rest:0,retriev:2,revers:2,review:2,save:0,see:2,self:2,send:2,serial:2,serializer_class:2,set:[0,2],setup:2,should:2,smileservic:0,some:2,specif:2,stabl:0,stage:2,staticmethod:2,statu:[0,2],string:2,suggest:1,suppli:2,support:0,tag:2,tagseri:2,than:0,them:2,thi:2,through:2,thu:2,track:2,tupl:2,under:2,under_review:2,updat:[0,2],upon:2,url:2,usag:0,use:0,used:2,user:[0,1,2],user_class:2,user_data:[],user_inst:2,uses:2,using:2,via:2,viewset:2,votablemixin:2,when:2,which:0,won:2,would:2,you:2,your:1},titles:["Welcome to \u201cDjango Edit Suggestion\u201d documentation!","Install","Usage"],titleterms:{"new":2,about:0,against:2,chang:0,creat:2,diff:2,django:[0,2],document:0,edit:[0,2],exampl:2,field:2,github:0,how:2,instal:1,integr:2,m2m:2,model:2,parent:2,publish:2,reject:2,repo:0,rest:2,set:1,suggest:[0,2],usag:2,use:2,welcom:0}}) \ No newline at end of file +Search.setIndex({docnames:["index","install","usage"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst","install.rst","usage.rst"],objects:{},objnames:{},objtypes:{},terms:{"126":2,"200":2,"401":2,"403":2,"boolean":2,"class":2,"default":2,"new":0,"return":2,"true":2,For:2,The:[0,2],abl:2,access:2,actual:2,add:[0,1,2],adding:0,admin:0,after:2,against:0,anoth:2,anymor:2,api:2,app:2,attach:2,attribut:2,auth:2,author:[0,2],base:2,being:2,between:2,build:2,can:[0,2],chang:2,change_status_condit:2,changed_field:2,charfield:2,check:2,children:2,com:0,come:2,condit:[0,2],condition_check:2,content:0,contrib:2,creat:0,create_edit_suggest:2,curent:2,current:2,customus:2,databas:0,def:2,delet:2,diff:0,diff_against_par:[0,2],differ:2,django:1,django_edit_suggest:1,django_rest:0,doe:2,dure:2,each:2,edit:1,edit_data:2,edit_suggest:2,edit_suggestion_author:2,edit_suggestion_id:2,edit_suggestion_inst:2,edit_suggestion_publish:[0,2],edit_suggestion_reason:2,edit_suggestion_reject:[0,2],edit_suggestion_reject_reason:2,editsuggest:2,editsuggestionparentmodel:2,editsuggestionseri:[0,2],empti:2,enabl:0,exampl:0,except:2,excluded_field:2,fals:2,field:0,form:2,from:[1,2],get:2,get_edit_suggestion_seri:2,has:2,have:[0,1,2],how:0,http:0,inherit:2,initi:2,insid:2,instal:0,installed_app:1,instanc:[0,2],instanti:2,integerfield:2,integr:0,invok:2,is_superus:2,json:2,just:2,kei:2,kwarg:2,list:0,lock:2,m2m:0,m2m_field:2,m2m_type_field:2,m2mselfmodel:2,mani:2,manytomanyfield:2,max_length:2,meta:2,method:2,model:0,modeldelta:2,modelseri:2,modelviewsetwitheditsuggest:[0,2],modifi:2,modul:2,name:2,need:2,new_record:2,object:2,old_record:2,option:2,other:0,packag:0,parent:0,parent_model_inst:2,parenteditseri:2,parentmodel:2,parentmodelinst:2,parentseri:2,parentviewset:2,pass:[0,2],permissiondeni:2,phase:2,pip:1,post:2,product:0,publish:0,pypi:1,queryset:2,rais:2,reason:2,receiv:2,refer:2,referenc:2,reject:0,relat:2,request:2,requir:1,resourc:[0,2],respons:2,rest:0,retriev:2,revers:2,review:2,rule:2,save:0,see:2,self:2,send:2,serial:2,serializer_class:2,set:[0,2],setup:2,should:2,smileservic:0,some:2,specif:2,stabl:0,stage:2,staticmethod:2,statu:[0,2],string:2,success:2,suggest:1,suppli:2,support:0,tag:2,tagseri:2,test:0,than:0,them:[0,2],thi:2,through:2,thu:2,track:2,tupl:2,under:2,under_review:2,updat:[0,2],upon:2,url:2,usag:0,use:0,used:2,user:[0,1,2],user_class:2,user_data:[],user_inst:2,uses:2,using:2,verifi:2,via:2,viewset:[0,2],votablemixin:2,when:2,which:0,won:2,would:2,you:2,your:1},titles:["Welcome to \u201cDjango Edit Suggestion\u201d documentation!","Install","Usage"],titleterms:{"new":2,about:0,against:2,chang:0,creat:2,diff:2,django:[0,2],document:0,edit:[0,2],exampl:2,field:2,github:0,how:2,instal:1,integr:2,m2m:2,model:2,parent:2,publish:2,reject:2,repo:0,rest:2,set:1,suggest:[0,2],usag:2,use:2,welcom:0}}) \ No newline at end of file diff --git a/docs/_build/html/usage.html b/docs/_build/html/usage.html index dddffdd..2a35e41 100644 --- a/docs/_build/html/usage.html +++ b/docs/_build/html/usage.html @@ -302,11 +302,18 @@

Django REST integration

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/

+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 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',