From 9cdea3c45f9c2cfd295194c06d6019616b0150aa Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Sat, 13 Jul 2024 15:27:26 +0200 Subject: [PATCH] upload form --- snapshot/views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/snapshot/views.py b/snapshot/views.py index 8202bc3..8a84d7c 100644 --- a/snapshot/views.py +++ b/snapshot/views.py @@ -1,7 +1,11 @@ from django.utils.translation import gettext_lazy as _ from django.views.generic.base import TemplateView +from django.views.generic.edit import FormView +from django.urls import reverse_lazy + from dashboard.mixins import DashboardView from snapshot.models import Snapshot +from snapshot.forms import UploadForm # from django.shortcuts import render # from rest_framework import viewsets # from snapshot.serializers import SnapshotSerializer @@ -25,3 +29,12 @@ class ListSnapshotsView(DashboardView, TemplateView): 'snapshots': snapshots, }) return context + + +class UploadView(DashboardView, FormView): + template_name = "upload.html" + section = "snapshots" + title = _("Upload Snapshot") + breadcrumb = "Snapshots / Upload" + success_url = reverse_lazy('snashot:list') + form_class = UploadForm