예제 #1
0
def get_url_desc(short_id, **kwargs):
	"""
	"""
	id = string_to_id(short_id)
	try:
		_us = UrlShortner.objects.get(id=id)
	except Exception, e:
		raise e
예제 #2
0
def get_long_url(short_id, **kwargs):
	"""
		map short url to long_url with help of DB
		and redirct to Original long_url page
	"""
	id = string_to_id(short_id)
	try:
		_us = UrlShortner.objects.get(id=id)
		_us.hits += 1
		_us.save()
	except Exception, e:
		raise e