from happyhour.models import Favorites
from django.shortcuts import render
from django.views.generic import View

class FavoritesView(View):
	template_name = "happyhour/favorite_list.html"
	def get(self, request, *args, **kwargs):
		if request.user.is_authenticated():
			user = request.user
			favorites = Favorites.objects.filter(user=user.id).order_by("-restaurant__rating")
			return render(request, self.template_name, {'favorites': favorites,
														'user': user})

7834d0a656a6bd6fdffccf4fff91378d81bc02b4
<mask token>

<mask token>


class FavoritesView(View):
    <mask token>

    def get(self, request, *args, **kwargs):
        if request.user.is_authenticated():
            user = request.user
            favorites = Favorites.objects.filter(user=user.id).order_by(
                '-restaurant__rating')
            return render(request, self.template_name, {'favorites':
                favorites, 'user': user})

<mask token>


class FavoritesView(View):
    template_name = 'happyhour/favorite_list.html'

    def get(self, request, *args, **kwargs):
        if request.user.is_authenticated():
            user = request.user
            favorites = Favorites.objects.filter(user=user.id).order_by(
                '-restaurant__rating')
            return render(request, self.template_name, {'favorites':
                favorites, 'user': user})

from happyhour.models import Favorites
from django.shortcuts import render
from django.views.generic import View


class FavoritesView(View):
    template_name = 'happyhour/favorite_list.html'

    def get(self, request, *args, **kwargs):
        if request.user.is_authenticated():
            user = request.user
            favorites = Favorites.objects.filter(user=user.id).order_by(
                '-restaurant__rating')
            return render(request, self.template_name, {'favorites':
                favorites, 'user': user})

from happyhour.models import Favorites
from django.shortcuts import render
from django.views.generic import View

class FavoritesView(View):
	template_name = "happyhour/favorite_list.html"
	def get(self, request, *args, **kwargs):
		if request.user.is_authenticated():
			user = request.user
			favorites = Favorites.objects.filter(user=user.id).order_by("-restaurant__rating")
			return render(request, self.template_name, {'favorites': favorites,
														'user': user})
