TzahiM / NeuroNet

World Wide Platform for projects generation and collaboration
10 stars 13 forks source link

Web API for mobile application #32

Open TzahiM opened 10 years ago

TzahiM commented 10 years ago

here are the following definitions, as defined with the mobile developer: - do what ever you feel like doing. 1 - Untill REST authentication shall be added we shall use add username and password fields for each request. 2 - Post api for test validity of a given username and password combination 3 - Firstly, GET APIs for all coplay.models. Delivering all fields. Example is DiscussionDetail is https://github.com/TzahiM/NeuroNet/blob/master/kuterless/coplay/api.py and the model based serializer in https://github.com/TzahiM/NeuroNet/blob/master/kuterless/coplay/serializers.py 4 - An "all included" GET for a discussion oblect and all the applicabale objects. from coplay.models import Discussion, Feedback, LikeLevel, Decision, Task, \ Viewer, FollowRelation, UserUpdate and AnonymousVisitorViewer (all the ones with a " = models.ForeignKey(Discussion)" fields)

5 - A POSTs API that are equivalent to all forms handling: url(r'add/$', views.add_discussion, name='add_discussion') url(r'^(?P\d+)/update/$', views.UpdateDiscussionDescView.as_view(), name='discussion_update'), url(r'^(?P\d+)/create-decision/$', views.CreateDecisionView.as_view(), name='create_decision'), url(r'^(?P\d+)/create-feedback/$', views.CreateFeedbackView.as_view(), name='create_feedback'), url(r'^(?P\d+)/create-task/$', views.CreateTaskView.as_view(), name='create_task'), url(r'^(?P\d+)/update_task/$', views.update_task_description, name='update_task_status_description'),

pk (of task)/close_task

url(r'^(?P<pk>\d+)/close_task/$', views.close_task, name='close_task'),

pk (of task)/abort_task

url(r'^(?P<pk>\d+)/abort_task/$', views.abort_task, name='abort_task'),

pk (of task)/re_open_task

url(r'^(?P<pk>\d+)/re_open_task/$', views.re_open_task, name='re_open_task'),
url(r'^(?P<username>.+)/start_follow_user/$', views.start_follow_user, name='start_follow_user'),

ex: labs/coplay/Tzahim/stop_follow_user

url(r'^(?P<username>.+)/stop_follow_user/$', views.stop_follow_user, name='stop_follow_user'),

pk (of decision)/vote

url(r'^(?P<pk>\d+)/vote/$', views.vote, name='vote'),

pk (of discussion)/start_follow

url(r'^(?P<pk>\d+)/start_follow/$', views.start_follow, name='start_follow'),

pk (of discussion)/stop_follow

url(r'^(?P<pk>\d+)/stop_follow/$', views.stop_follow, name='stop_follow'),

6 - The same for memcache application 7 - I do not have time to debug your commits. So please add your tests to coplay.test.py

TzahiM commented 10 years ago

also add POST APIs that are equivalent to: url(r'^register/$', views.sign_up, name='sign_up'),
url(r'^update_profile/$', views.update_profile, name='update_profile'), url(r'^stop_email/$', views.stop_email, name='stop_email'),

url(r'^shop_update/(?P<pk>[0-9]+)/$', views.UpdateShopView.as_view(), name='shop_update'),
url(r'^product_create/(?P<pk>[0-9]+)/$', views.CreateProductView.as_view(), name='product_create'),
url(r'^product_update/(?P<pk>[0-9]+)/$', views.UpdateProductView.as_view(), name='product_update'),
url(r'^product_delete/(?P<pk>[0-9]+)/$', views.DeleteProductView.as_view(success_url='memecache:root'), name='product_delete'),

url(r'^update_product_selection/(?P<pk>[0-9]+)/$', views.update_product_selection, name='update_product_selection'),

url(r'^cart_checkout/(?P<pk>[0-9]+)/$', views.cart_checkout, name='cart_checkout'),
url(r'^account_details/(?P<pk>[0-9]+)/$', views.account_details, name='account_details'),
url(r'^item_voucher_send/(?P<pk>[0-9]+)/$', views.item_voucher_send, name='item_voucher_send'),
url(r'^item_voucher_use/(?P<pk>[0-9]+)/$', views.item_voucher_use, name='item_voucher_use'),