Added small self-discovery feature to API.

pull/1/head
Stanislaw Klekot 2014-07-01 22:40:44 +02:00
rodzic c51d4c8f0e
commit e919e8f04c
2 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -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'),

Wyświetl plik

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