Skip to content
Snippets Groups Projects
Commit 33b15bae authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

generic job update view

parent bd6b3021
No related branches found
No related tags found
2 merge requests!13Edit view job,!7Simulator
......@@ -68,7 +68,7 @@ urlpatterns = [
path('assembly-simulator/create/<str:step>/', simulator_wizard, name='simulator-create-step'),
path('assembly-simulator/create/', simulator_wizard, name='simulator-create'),
path('assembly-simulator/<slug:uuid>/', views.JobSimulatorResult.as_view(), name='simulator-detail'),
path('assembly-simulator-job/<slug:uuid>/pcr/', views.JobPCREdit.as_view(), name='simulator-pcr-edit'),
path('assembly-simulator/<slug:uuid>/pcr-edit/', views.JobPCREdit.as_view(), name='simulator-pcr-edit'),
path('assembly/<int:pk>/download/', views.AssemblyDetailDownloadView.as_view(), name='assembly-download'),
path('assembly/<int:pk>/delete/', views.AssemblyDeleteView.as_view(), name='assembly-delete'),
path('fragment', views.show_fragment, name='fragment'),
......
import traceback
from abc import ABC, abstractmethod
from io import BytesIO
from typing import Tuple
......@@ -116,14 +117,13 @@ class JobSimulatorResult(DetailView):
slug_url_kwarg = 'uuid'
class JobPCREdit(
class SimulatorJobEdit(
ABC,
UpdateView,
):
model = models.SimulatorJob
form_class = forms.PCRModelForm
slug_field = 'uuid'
slug_url_kwarg = 'uuid'
success_url = reverse_lazy("assemblies:home")
template_name = "assemblies/form_host.html"
def form_valid(self, form):
......@@ -132,5 +132,18 @@ class JobPCREdit(
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["title"] = _("PCR primers to use for gel simulation")
context["title"] = self.get_title()
return context
@abstractmethod
def get_title(self):
pass
class JobPCREdit(
SimulatorJobEdit,
):
form_class = forms.PCRModelForm
def get_title(self):
return _("PCR primers to use for gel simulation")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment