mirror of
https://github.com/ferdzo/serviceCRM.git
synced 2026-04-05 05:06:25 +00:00
Small updates
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -206,4 +206,5 @@ pyvenv.cfg
|
|||||||
pip-selfcheck.json
|
pip-selfcheck.json
|
||||||
.idea
|
.idea
|
||||||
# End of https://www.toptal.com/developers/gitignore/api/venv,dotenv,intellij,pycharm
|
# 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
19
.vscode/launch.json
vendored
Normal 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
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"cmake.configureOnOpen": false
|
||||||
|
}
|
||||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
@@ -23,5 +23,4 @@ urlpatterns = [
|
|||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path("<int:question_id>/", view.ReportById.ReportById, name="detail"),
|
path("<int:question_id>/", view.ReportById.ReportById, name="detail"),
|
||||||
path("insert/", view.InsertNew.insert, name="insert"),
|
path("insert/", view.InsertNew.insert, name="insert"),
|
||||||
path("done/<int:question_id>", view.done, name="done"),
|
path("done/<int:id>/", view.done, name="done"),]
|
||||||
]
|
|
||||||
|
|||||||
@@ -21,13 +21,12 @@ def index(request):
|
|||||||
#
|
#
|
||||||
class ReportById(generic.DetailView):
|
class ReportById(generic.DetailView):
|
||||||
model = Insert
|
model = Insert
|
||||||
template_name = "serviceCRM/id.html"
|
template_name = "serviceCRM/python.exe -m pip install --upgrade pipid.html"
|
||||||
|
|
||||||
def ReportById(request, question_id):
|
def ReportById(request, question_id):
|
||||||
req = get_object_or_404(Insert, id=question_id)
|
req = get_object_or_404(Insert, id=question_id)
|
||||||
context = {"name": req.name, "phone": req.phone, "desc": req.description, "date": req.date}
|
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):
|
class InsertNew(generic.View):
|
||||||
model = Insert
|
model = Insert
|
||||||
@@ -48,11 +47,11 @@ class InsertNew(generic.View):
|
|||||||
|
|
||||||
class TableView(SingleTableView):
|
class TableView(SingleTableView):
|
||||||
model = Insert
|
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)
|
def done(request, id):
|
||||||
|
req = get_object_or_404(Insert, id=id)
|
||||||
if req.isDone():
|
if req.isDone():
|
||||||
return HttpResponse("Done")
|
return HttpResponse("Done")
|
||||||
return HttpResponse("Not Done")
|
return HttpResponse("Not Done")
|
||||||
|
|||||||
Reference in New Issue
Block a user