kopia lustrzana https://github.com/HackerspaceWroclaw/wlokalu
Added small self-discovery feature to API.
rodzic
c51d4c8f0e
commit
e919e8f04c
|
@ -6,6 +6,7 @@ from django.conf import settings
|
|||
#-----------------------------------------------------------------------------
|
||||
|
||||
urlpatterns = patterns('wlokalu.api.v1.views',
|
||||
(r'^$', 'list_elements', {'subpages': ['person', 'sensor']}),
|
||||
(r'^person/?$', 'list_presence'),
|
||||
(r'^person/(?P<nick>.+)$', 'person'),
|
||||
(r'^sensor/?$', 'list_sensors'),
|
||||
|
|
|
@ -25,6 +25,13 @@ def return_json(function):
|
|||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@csrf_exempt
|
||||
@return_json
|
||||
def list_elements(request, subpages):
|
||||
return subpages
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@csrf_exempt
|
||||
@return_json
|
||||
def person(request, nick):
|
||||
|
|
Ładowanie…
Reference in New Issue