def addfavorites(request, msgid): ''' Adding to and accessing favorites list ''' msg = FavoriteRenderer.addToFavorites(request.user.email, msgid) messages.info(request, msg) mslist = FavoriteRenderer.getFavorites(request.user.email) return HttpResponseRedirect('/home')
def removefavorites(request, msgid): ''' Removing from favorites list ''' msg = FavoriteRenderer.removeFromFavorites(request.user.email, msgid) messages.info(request, msg) mslist = FavoriteRenderer.getFavorites(request.user.email) #return HttpResponseRedirect('/home') return render_to_response('favorites.html', {'mslist': mslist}, context_instance=RequestContext(request))
def favorites(request): ''' Accessing favorites list ''' mslist = FavoriteRenderer.getFavorites(request.user.email) return render_to_response('favorites.html', {'mslist': mslist}, context_instance=RequestContext(request))