From 97b3d99ce6153980b0d5313b4e82f8d6dc744c08 Mon Sep 17 00:00:00 2001 From: sichan Date: Sun, 16 Jun 2024 06:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复了账号运营管理记录的编辑表单不显示内容问题 2. 修复了对象表单日期时间组件不显示时间的问题 --- application/opa_mgnt/views.py | 4 ++-- templates/form_partial.html | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/opa_mgnt/views.py b/application/opa_mgnt/views.py index 0ffb4cc..96dbc50 100644 --- a/application/opa_mgnt/views.py +++ b/application/opa_mgnt/views.py @@ -213,9 +213,9 @@ def acc_op_mgmt_list_modify(request): form_html = render_to_string('form_partial.html', {'form': form}, request) return JsonResponse({"form_html": form_html, "errors": form.errors}, status=400) elif request.method == 'GET': - if 'record_id' in request.GET: + if 'id' in request.GET: try: - instance = AccountOperationManagement.objects.get(record_id=request.GET['record_id']) + instance = AccountOperationManagement.objects.get(record_id=request.GET['id']) form = AccountOperationManagementForm(instance=instance) except AccountOperationManagement.DoesNotExist: raise Http404("对象不存在") diff --git a/templates/form_partial.html b/templates/form_partial.html index 72a08e3..2056b30 100644 --- a/templates/form_partial.html +++ b/templates/form_partial.html @@ -25,6 +25,8 @@ {% elif field.field.widget.input_type == "date" %} + {% elif field.field.widget.input_type == "datetime-local" %} + {% elif field.field.widget.input_type == "email" %} {% elif field.field.widget.input_type == "password" %} @@ -66,6 +68,8 @@ {% elif field.field.widget.input_type == "date" %} + {% elif field.field.widget.input_type == "datetime-local" %} + {% elif field.field.widget.input_type == "month" %} {% elif field.field.widget.input_type == "email" %}