Remove the settings.py file (for security)

Also get the rate lot totally working
This commit is contained in:
Bradlee Speice
2013-10-18 22:42:08 -04:00
parent 664aec18ab
commit e1c789d8e3
4 changed files with 4 additions and 163 deletions

View File

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

View File

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