Example #1
0
	def get(self, current_url, locationurl):
		location = models.Location.gql("WHERE indexname = :1", locationurl.lower()).get()
		items = models.get_items_for_location(location, 20, 0)
		template_values = {
							"items": items,
		}
		viewhelpers.render_template(self, "ajaxviews/locationitems", template_values)
Example #2
0
	def get(self, current_url, locationurl):
		useraccount = models.get_current_auth_user(self)
		location = models.Location.gql("WHERE indexname = :1", locationurl.lower()).get()
		items = models.get_items_for_location(location, 20, 0)
		locationrating = models.LocationRatings.gql("WHERE location = :1", location).get()
		userlocations = models.get_userlocations_for_location(location, 10, 0)
		template_values = {
			'items': items,
			'useraccount': useraccount,
			'user_action_url': helpers.get_user_action_url(useraccount, current_url),
			'locationurl': locationurl,
			'ratingform': models.RatingForm(),
			'itemform': models.ItemForm(),
			'media_types': helpers.get_media_types(),
			'form_tags': helpers.get_form_tags(),
			'locations': models.Location.all().order('name'),
			'location': location,
			'locationrating': locationrating,
			'userlocations': userlocations,
		}
		if location:
			template_values['location'] = location
		viewhelpers.render_template(self, "views/location", template_values)