Skip to content

Commit

Permalink
added EventDetail API
Browse files Browse the repository at this point in the history
  • Loading branch information
avara1986 committed Sep 11, 2014
1 parent c52364b commit 856c36c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions events/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class EventList(generics.ListAPIView):
permissions.AllowAny
]

class EventDetail(generics.RetrieveAPIView):
model = Event
serializer_class = EventSerializer
lookup_field = 'pk'

class AttendeeList(APIView):
"""
Expand Down
4 changes: 2 additions & 2 deletions events/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.conf.urls import patterns, url, include

from events.api.api import EventList, AttendeeList
from events.api.api import EventList, EventDetail, AttendeeList


event_urls = patterns('',
#url(r'^/(?P<username>[0-9a-zA-Z_-]+)/posts$', UserPostList.as_view(), name='userpost-list'),
#url(r'^/(?P<username>[0-9a-zA-Z_-]+)$', UserDetail.as_view(), name='user-detail'),
url(r'^/(?P<pk>[0-9a-zA-Z_-]+)$', EventDetail.as_view(), name='event-detail'),
url(r'^/$', EventList.as_view(), name='event-list')
)

Expand Down

0 comments on commit 856c36c

Please sign in to comment.