mirror of
https://github.com/bspeice/UNCCGameDay-Server
synced 2024-12-04 13:58:14 -05:00
Add a single-lot view
This commit is contained in:
parent
4bd46f9e71
commit
92b8bb6392
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,7 @@
|
||||
*.pyc
|
||||
*.sqlite
|
||||
*.sublime*
|
||||
*.swp
|
||||
bin/
|
||||
include/
|
||||
lib/
|
||||
|
@ -4,5 +4,6 @@ import views
|
||||
urlpatterns = patterns('gameday.views',
|
||||
url('^$', 'api_root'),
|
||||
url('^lots/$', views.ParkingLotList.as_view(), name='parking-lots'),
|
||||
url('^lots/(?P<lot>)$', views.SingleParkingLotList.as_view(), name='parking-lot'),
|
||||
url('^rate/$', views.RateLot.as_view(), name='parking-rating'),
|
||||
)
|
@ -26,6 +26,15 @@ class ParkingLotList(APIView):
|
||||
serializer = ParkingLotSerializer(parking_lots, many=True)
|
||||
return Response(serializer.data)
|
||||
|
||||
class SingleParkingLotList(APIView):
|
||||
"""
|
||||
List a single parking lot
|
||||
"""
|
||||
|
||||
def get(self, request, lot):
|
||||
parking_lot = ParkingLot.objects.filter(location=lot)
|
||||
return Response(ParkingLotSerializer(parking_lot))
|
||||
|
||||
class RateLot(APIView):
|
||||
"""
|
||||
Rate a parking lot
|
||||
|
Loading…
Reference in New Issue
Block a user