.
This commit is contained in:
@@ -24,6 +24,10 @@ from tinymce.widgets import TinyMCE
|
||||
|
||||
from dal import autocomplete
|
||||
|
||||
class ConditionForm(ModelForm):
|
||||
class Meta:
|
||||
model = Condition
|
||||
exclude = []
|
||||
|
||||
class SeriesFindingForm(ModelForm):
|
||||
class Meta:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{{condition.name}}<br/>
|
||||
{{condition.primary}}<br/>
|
||||
{{condition.primary}}<br/delete>
|
||||
{{condition.synonym}}<br/>
|
||||
</div>
|
||||
|
||||
|
||||
+3
-1
@@ -11,7 +11,9 @@ urlpatterns = [
|
||||
path("author/", views.author_list, name="author_list"),
|
||||
path("cases/", views.CaseView.as_view(), name="case_view"),
|
||||
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
||||
path("condition/", views.condition_detail, name="condition_detail"),
|
||||
path("condition/<int:pk>", views.condition_detail, name="condition_detail"),
|
||||
path("condition/<int:pk>/delete", views.ConditionDelete.as_view(), name="condition_delete"),
|
||||
path("condition/<int:pk>/update", views.ConditionUpdate.as_view(), name="condition_update"),
|
||||
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
||||
path("series/", views.SeriesView.as_view(), name="series_view"),
|
||||
path("series/<int:pk>", views.series_detail, name="series_detail"),
|
||||
|
||||
@@ -28,6 +28,7 @@ from django.http import HttpResponseRedirect, HttpResponse
|
||||
|
||||
from .forms import (
|
||||
CaseForm,
|
||||
ConditionForm,
|
||||
SeriesForm,
|
||||
SeriesImageFormSet,
|
||||
SeriesFormSet,
|
||||
@@ -195,6 +196,17 @@ class SeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||
model = Series
|
||||
success_url = reverse_lazy("atlas:series_view")
|
||||
|
||||
class ConditionDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||
model = Condition
|
||||
success_url = reverse_lazy("atlas:condition_view")
|
||||
|
||||
class FindingDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||
model = Finding
|
||||
success_url = reverse_lazy("atlas:finding_view")
|
||||
|
||||
class StructureDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
|
||||
model = Structure
|
||||
success_url = reverse_lazy("atlas:structure_view")
|
||||
|
||||
@login_required
|
||||
@user_is_author_or_atlas_checker
|
||||
@@ -315,6 +327,13 @@ class SeriesUpdate(
|
||||
return super().form_invalid(form)
|
||||
|
||||
|
||||
class ConditionUpdate(
|
||||
RevisionMixin, LoginRequiredMixin, AuthorOrCheckerRequiredMixin, UpdateView
|
||||
):
|
||||
model = Condition
|
||||
form_class = ConditionForm
|
||||
|
||||
|
||||
class AtlasCreateBase(RevisionMixin, LoginRequiredMixin):
|
||||
model = Case
|
||||
form_class = CaseForm
|
||||
|
||||
Reference in New Issue
Block a user