src/cm/api/urls.py
changeset 287 fc5ed157ebfe
child 293 2c52e4453bf7
equal deleted inserted replaced
282:b5deb8e32219 287:fc5ed157ebfe
       
     1 from django.conf.urls.defaults import *
       
     2 
       
     3 from piston.resource import Resource
       
     4 from piston.authentication import HttpBasicAuthentication
       
     5 
       
     6 from cm.api.handlers import * 
       
     7 auth = HttpBasicAuthentication(realm='Comt API')
       
     8 
       
     9 text_handler = Resource(handler=TextHandler, authentication=auth)
       
    10 textversion_handler = Resource(handler=TextVersionHandler, authentication=auth)
       
    11 text_list_handler = Resource(handler=TextListHandler, authentication=auth)
       
    12 text_delete_handler = Resource(handler=TextDeleteHandler, authentication=auth)
       
    13 text_pre_edit_handler = Resource(handler=TextPreEditHandler, authentication=auth)
       
    14 text_edit_handler = Resource(handler=TextEditHandler, authentication=auth)
       
    15 setuser_handler = Resource(handler=SetUserHandler, authentication=None)
       
    16 
       
    17 #doc_handler = Resource(handler=DocHandler)
       
    18 
       
    19 urlpatterns = patterns('',
       
    20    url(r'^text/(?P<key>\w*)/$', text_handler),
       
    21    url(r'^text/$', text_list_handler),
       
    22    url(r'^text/(?P<key>\w*)/delete/$', text_delete_handler),
       
    23    url(r'^text/(?P<key>\w*)/pre_edit/$', text_pre_edit_handler),
       
    24    url(r'^text/(?P<key>\w*)/edit/$', text_edit_handler),
       
    25    url(r'^text/(?P<key>\w*)/(?P<version_key>\w*)/$', textversion_handler),
       
    26    url(r'^setuser/$', setuser_handler),
       
    27    url(r'^doc/$', documentation),
       
    28 )