de09605d07157abde82288396152a02130756efc
[redakcja.git] / apps / api / urls.py
1 __author__="lreqc"
2 __date__ ="$2009-09-17 16:16:54$"
3
4 from django.conf.urls.defaults import *
5
6 from api.resources import *
7
8 FORMAT_EXT = r"\.(?P<emitter_format>xml|json|yaml)$"
9
10 urlpatterns = patterns('',
11 #    url(r'^hello$', hello_resource, {'emitter_format': 'json'}),
12 #    url(r'^hello\.(?P<emitter_format>.+)$', hello_resource),
13
14     # Toolbar
15     url(r'^toolbar/buttons$', toolbar_buttons, {'emitter_format': 'json'}),
16
17     # Toolbar
18     url(r'^toolbar/scriptlets$', scriptlets, {'emitter_format': 'json'}),
19     
20     # Documents
21     url(r'^documents$', library_resource,
22         {'emitter_format': 'json'}, name="document_list_view"),
23
24     url(r'^documents'+FORMAT_EXT, library_resource,
25         name="document_list_view_withformat"),
26         
27     url(r'^documents/(?P<docid>[^/]+)'+FORMAT_EXT,
28         document_resource, name="document_view_withformat"),
29
30     url(r'^documents/(?P<docid>[^/]+)$',
31         document_resource, {'emitter_format': 'json'},
32         name="document_view"),
33     
34     url(r'^documents/(?P<docid>[^/]+)/text$',
35         document_text_resource, {'emitter_format': 'rawxml'},
36         name="doctext_view"),
37
38     url(r'^documents/(?P<docid>[^/]+)/dc' + FORMAT_EXT,
39         document_dc_resource,
40         name="docdc_view_withformat"),
41
42     url(r'^documents/(?P<docid>[^/]+)/dc$',
43         document_dc_resource, {'emitter_format': 'json'},
44         name="docdc_view"),
45
46     url(r'^documents/(?P<docid>[^/]+)/parts$',
47         document_resource, {'emitter_format': 'json'},
48         name="docparts_view"),
49         
50   #  url(r'^posts/(?P<post_slug>[^/]+)/$', blogpost_resource),
51   #  url(r'^other/(?P<username>[^/]+)/(?P<data>.+)/$', arbitrary_resource),
52 )
53