requirements.txt and update

This commit is contained in:
ferdzo
2023-04-24 23:34:26 +02:00
parent a0de6650a4
commit 0ac17fd747
4 changed files with 6 additions and 7 deletions

BIN
requirements.txt Normal file

Binary file not shown.

View File

@@ -6,7 +6,5 @@ class InsertTable(tables.Table):
class Meta:
model = Insert
template_name = "serviceCRM/list.html"
attrs = {'class':'table table-sm'}
fields = ['id', 'name', 'phone', 'description', 'date', 'done', 'edit']
edit = tables.TemplateColumn(template_name="serviceCRM/edit.html", verbose_name="edit", orderable=False)
edit = tables.TemplateColumn(template_name="serviceCRM/edit.html", verbose_name=("edit"), orderable=False)

View File

@@ -19,7 +19,7 @@ from django.urls import path
import serviceCRM.views as view
urlpatterns = [
path("", view.List.as_view(), name="index"),
path("", view.TableView.as_view(), name="index"),
path('admin/', admin.site.urls),
path("<int:question_id>/", view.ReportById.ReportById, name="detail"),
path("insert/", view.InsertNew.insert, name="insert"),

View File

@@ -6,6 +6,7 @@ from .tables import InsertTable
from .models import Insert
from django_tables2 import SingleTableView
# from django.template import loader
def index(request):
@@ -31,6 +32,7 @@ class ReportById(generic.DetailView):
class InsertNew(generic.View):
model = Insert
template_name = "serviceCRM/form.html"
def insert(request):
if request.method == 'POST':
form = InputForm(request.POST)
@@ -44,11 +46,10 @@ class InsertNew(generic.View):
return render(request, InsertNew.template_name, {'form': form})
class List(SingleTableView):
class TableView(SingleTableView):
model = Insert
table_class = InsertTable
template_name = 'serviceCRM/list.html'
template_name = "serviceCRM/list.html"
def done(request, question_id):
req = get_object_or_404(Insert, id=question_id)