Try to fix issue 4
This commit is contained in:
@ -35,6 +35,9 @@ from .services.csv_processor import EntryCSVProcessor
|
|||||||
class EntryAdmin(admin.ModelAdmin):
|
class EntryAdmin(admin.ModelAdmin):
|
||||||
list_display = ['team', 'event', 'category', 'date', 'is_active']
|
list_display = ['team', 'event', 'category', 'date', 'is_active']
|
||||||
|
|
||||||
|
# change_list_templateの追加
|
||||||
|
change_list_template = 'admin/entry/change_list.html' # この行を追加
|
||||||
|
|
||||||
def get_urls(self):
|
def get_urls(self):
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
urls = super().get_urls()
|
urls = super().get_urls()
|
||||||
|
|||||||
11
rog/templates/admin/entry/change_list.html
Normal file
11
rog/templates/admin/entry/change_list.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends "admin/change_list.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block object-tools-items %}
|
||||||
|
{{ block.super }}
|
||||||
|
<li>
|
||||||
|
<a href="{% url 'admin:entry_upload_csv' %}" class="addlink">
|
||||||
|
{% translate "Upload CSV" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endblock %}
|
||||||
17
rog/templates/admin/entry/upload_csv.html
Normal file
17
rog/templates/admin/entry/upload_csv.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{% extends "admin/base_site.html" %}
|
||||||
|
{% load i18n static %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div>
|
||||||
|
<form action="." method="post" enctype="multipart/form-data">
|
||||||
|
{% csrf_token %}
|
||||||
|
<div>
|
||||||
|
<label for="csv_file">Choose CSV file:</label>
|
||||||
|
<input type="file" name="csv_file" required>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 20px;">
|
||||||
|
<input type="submit" value="Upload CSV">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user