Small updates

This commit is contained in:
ferdzo
2024-03-15 01:07:21 +01:00
parent 738de302be
commit 90fb3b6438
6 changed files with 30 additions and 9 deletions

3
.gitignore vendored
View File

@@ -206,4 +206,5 @@ pyvenv.cfg
pip-selfcheck.json
.idea
# End of https://www.toptal.com/developers/gitignore/api/venv,dotenv,intellij,pycharm
serviceCRM/__pycache__
__pycache__/
*.py[cod]

19
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Django",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}\\manage.py",
"args": [
"runserver"
],
"django": true,
"autoStartBrowser": false
}
]
}

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}

Binary file not shown.

View File

@@ -23,5 +23,4 @@ urlpatterns = [
path('admin/', admin.site.urls),
path("<int:question_id>/", view.ReportById.ReportById, name="detail"),
path("insert/", view.InsertNew.insert, name="insert"),
path("done/<int:question_id>", view.done, name="done"),
]
path("done/<int:id>/", view.done, name="done"),]

View File

@@ -21,13 +21,12 @@ def index(request):
#
class ReportById(generic.DetailView):
model = Insert
template_name = "serviceCRM/id.html"
template_name = "serviceCRM/python.exe -m pip install --upgrade pipid.html"
def ReportById(request, question_id):
req = get_object_or_404(Insert, id=question_id)
context = {"name": req.name, "phone": req.phone, "desc": req.description, "date": req.date}
return HttpResponse(render(request, ReportById.template_name, context))
return HttpResponse(f"Report ID: {question_id} \nName: {req.name} \nPhone: {req.phone} \nDescription: {req.description} \nDate: {req.date} \nDone: {req.done}")
class InsertNew(generic.View):
model = Insert
@@ -48,11 +47,11 @@ class InsertNew(generic.View):
class TableView(SingleTableView):
model = Insert
table_class = InsertTable
template_name = "serviceCRM/list.html"
def done(request, question_id):
req = get_object_or_404(Insert, id=question_id)
def done(request, id):
req = get_object_or_404(Insert, id=id)
if req.isDone():
return HttpResponse("Done")
return HttpResponse("Not Done")