Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Commit

Permalink
Changed the application name from location to locations basing on iss…
Browse files Browse the repository at this point in the history
…ue 1

git-svn-id: http://django-locations.googlecode.com/svn/trunk@6 7dd5b791-a154-0410-b265-8553752079d8
  • Loading branch information
yashh committed Aug 17, 2008
1 parent d7feba0 commit 6a3b576
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions locations/urls.py
Expand Up @@ -4,7 +4,7 @@
# and then checkin in to that place.

urlpatterns = patterns('',
(r'^$', 'location.views.your_locations'),
(r'new/$', 'location.views.new'),
(r'checkin/$', 'location.views.checkin'),
(r'^$', 'locations.views.your_locations'),
(r'new/$', 'locations.views.new'),
(r'checkin/$', 'locations.views.checkin'),
)
10 changes: 5 additions & 5 deletions locations/views.py
Expand Up @@ -18,7 +18,7 @@
def your_locations(request):
user = request.user
locations = Location.objects.filter(user=user)
return render_to_response("location/your_locations.html", {"locations": locations}, context_instance=RequestContext(request))
return render_to_response("locations/your_locations.html", {"locations": locations}, context_instance=RequestContext(request))

# Gets data from the search form and tries to geocode that location.
# I am passing an invisible checkin form which contains 'value={{ location.place}}' and other attributes
Expand All @@ -34,10 +34,10 @@ def new(request):
place, (lat, lng) = y.geocode(p)
location = {'place': place, 'latitude': lat, 'longitude': lng}
checkin_form = CheckinForm()
return render_to_response("location/checkin.html", {"location": location, "checkin_form": checkin_form})
return render_to_response("locations/checkin.html", {"location": location, "checkin_form": checkin_form})
else:
location_form = LocationForm()
return render_to_response("location/new.html", {"location_form": location_form})
return render_to_response("locations/new.html", {"location_form": location_form})

# When user clicks checkin, we write into the model Location with user, place, latitude and longitude info. Of course ,along with
# the datetime of the checkin.
Expand All @@ -49,8 +49,8 @@ def checkin(request):
if checkin_form.is_valid():
c = Location(place=checkin_form.cleaned_data['place'], latitude=checkin_form.cleaned_data['latitude'], longitude=checkin_form.cleaned_data['longitude'], user=request.user, time_checkin= datetime.datetime.now())
c.save()
return HttpResponseRedirect(reverse('location.views.your_locations'))
return HttpResponseRedirect(reverse('locations.views.your_locations'))
else:
return HttpResponseRedirect(reverse('location.views.new'))
return HttpResponseRedirect(reverse('locations.views.new'))


0 comments on commit 6a3b576

Please sign in to comment.