From 20e0bee33aa7ea542f3801ae1f4bef58ded45919 Mon Sep 17 00:00:00 2001 From: Rubikium <30288416+Rubikium@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:32:35 +0800 Subject: [PATCH 1/5] Use django's FileField for file handling --- .../cms/polls/templates/cms_polls/menu.html | 1 - django_material_demo/cms/polls/urls.py | 3 +- django_material_demo/cms/polls/views/file.py | 13 --- .../cms/polls/views/question.py | 9 ++- .../django_material_demo/settings.py | 2 + django_material_demo/polls/admin.py | 19 +---- .../polls/migrations/0012_add_temp_fields.py | 68 ++++++++++++++++ ...ttachment_file_alter_question_thumbnail.py | 23 ++++++ .../0014_remove_file_model_and_more.py | 81 +++++++++++++++++++ django_material_demo/polls/models.py | 19 +---- django_material_demo/requirements.txt | 1 + 11 files changed, 187 insertions(+), 52 deletions(-) delete mode 100644 django_material_demo/cms/polls/views/file.py create mode 100644 django_material_demo/polls/migrations/0012_add_temp_fields.py create mode 100644 django_material_demo/polls/migrations/0013_alter_attachment_file_alter_question_thumbnail.py create mode 100644 django_material_demo/polls/migrations/0014_remove_file_model_and_more.py diff --git a/django_material_demo/cms/polls/templates/cms_polls/menu.html b/django_material_demo/cms/polls/templates/cms_polls/menu.html index a07ef12..c5f1022 100644 --- a/django_material_demo/cms/polls/templates/cms_polls/menu.html +++ b/django_material_demo/cms/polls/templates/cms_polls/menu.html @@ -1,7 +1,6 @@ {% comment %} https://materializecss.com/sidenav.html {% endcomment %}