.
This commit is contained in:
+11
-1
@@ -1,4 +1,5 @@
|
||||
from difflib import HtmlDiff, SequenceMatcher
|
||||
from django import forms
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.shortcuts import get_object_or_404, render
|
||||
from django.views.generic.edit import UpdateView, CreateView
|
||||
@@ -26,10 +27,19 @@ class FormatsCreateView(CreateView):
|
||||
template_name_suffix = "_update_form"
|
||||
fields = ['name', 'format', 'inherits']
|
||||
|
||||
|
||||
class FormatsForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Formats
|
||||
fields = ['name', 'format', 'specialties', 'inherits']
|
||||
widgets = {
|
||||
'specialties': forms.CheckboxSelectMultiple()}
|
||||
|
||||
class FormatsUpdateView(UpdateView):
|
||||
model = Formats
|
||||
template_name_suffix = "_update_form"
|
||||
fields = ['name', 'format', 'specialties', 'inherits']
|
||||
#fields = ['name', 'format', 'specialties', 'inherits']
|
||||
form_class = FormatsForm
|
||||
|
||||
class EntryTableView(SingleTableMixin, FilterView):
|
||||
model = Entry
|
||||
|
||||
Reference in New Issue
Block a user