mirror of
https://github.com/bspeice/UNCCGameDay-Server
synced 2025-07-02 06:16:51 -04:00
Remove the settings.py file (for security)
Also get the rate lot totally working
This commit is contained in:
@ -84,6 +84,6 @@ class ParkingRating(models.Model):
|
||||
RATING_FULL: 100,
|
||||
}
|
||||
|
||||
rating = models.CharField(max_length=10, choices=RATING_CHOICES)
|
||||
rating = models.CharField(max_length=3, choices=RATING_CHOICES)
|
||||
created = models.DateTimeField(default=datetime.now)
|
||||
parking_lot = models.ForeignKey(ParkingLot)
|
||||
|
@ -8,6 +8,7 @@ from rest_framework.decorators import api_view
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
@api_view(('GET',))
|
||||
def api_root(request):
|
||||
@ -33,7 +34,6 @@ class SingleParkingLotList(APIView):
|
||||
"""
|
||||
|
||||
def get(self, request, lot):
|
||||
print "Received lot: '" + lot + "'"
|
||||
parking_lot = get_object_or_404(ParkingLot, location=lot)
|
||||
return Response(ParkingLotSerializer(parking_lot).data)
|
||||
|
||||
@ -44,6 +44,7 @@ class RateLot(APIView):
|
||||
**POST**: Rate a parking lot
|
||||
"""
|
||||
|
||||
@csrf_exempt
|
||||
def post(self, request):
|
||||
'Rate a parking lot'
|
||||
rating = ParkingRatingSerializer(data=request.DATA)
|
||||
|
Reference in New Issue
Block a user