You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
567 B
21 lines
567 B
from django.shortcuts import render
|
|
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
|
|
from django.views.generic import ListView, CreateView, DeleteView
|
|
from .models import Review
|
|
from .forms import ReviewForm
|
|
|
|
|
|
class ReviewsView(LoginRequiredMixin, ListView):
|
|
login_url = '/users/login/'
|
|
model = Review
|
|
template_name = 'reviews_list.html'
|
|
|
|
|
|
class ReviewCreateView(CreateView):
|
|
model = Review
|
|
form_class = ReviewForm
|
|
template_name = 'review_create.html'
|
|
|
|
|
|
class ReviewDeleteView(DeleteView):
|
|
model = Review
|
|
|