@ -4,8 +4,9 @@ from django.http import JsonResponse
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import FormView, DetailView
|
||||
|
||||
from .forms import FileForm
|
||||
from .models import File
|
||||
from .forms import ImageFileForm, FileForm
|
||||
from .models import ImageFile, File
|
||||
|
||||
|
||||
class FileUploadView(LoginRequiredMixin, FormView):
|
||||
model = File
|
||||
@ -26,6 +27,11 @@ class FileUploadView(LoginRequiredMixin, FormView):
|
||||
return JsonResponse({'is_valid': False, 'errors': form.errors})
|
||||
|
||||
|
||||
class ImageFileUploadView(FileUploadView):
|
||||
model = ImageFile
|
||||
form_class = ImageFileForm
|
||||
|
||||
|
||||
class FileDeleteView(LoginRequiredMixin, DetailView):
|
||||
model = File
|
||||
|
||||
|
Reference in New Issue
Block a user