photo_point and cppoint were reverted to checkin_point

This commit is contained in:
2025-08-30 04:39:45 +09:00
parent cb399f14bf
commit 0ef0bde5b1
7 changed files with 291 additions and 21 deletions

View File

@ -1067,7 +1067,7 @@ class Location2025Admin(LeafletGeoAdmin):
'fields': ('latitude', 'longitude', 'location', 'address')
}),
('ポイント設定', {
'fields': ('cp_point', 'photo_point', 'buy_point')
'fields': ('checkin_point', 'buy_point')
}),
('チェックイン設定', {
'fields': ('checkin_radius', 'auto_checkin')
@ -1167,29 +1167,35 @@ class Location2025Admin(LeafletGeoAdmin):
})
def export_csv_view(self, request):
"""CSVエクスポート"""
"""CSVエクスポート(全フィールド対応)"""
import csv
from django.http import HttpResponse
from django.utils import timezone
response = HttpResponse(content_type='text/csv; charset=utf-8')
response['Content-Disposition'] = f'attachment; filename="checkpoints_{timezone.now().strftime("%Y%m%d_%H%M%S")}.csv"'
response['Content-Disposition'] = f'attachment; filename="checkpoints_enhanced_{timezone.now().strftime("%Y%m%d_%H%M%S")}.csv"'
# BOM付きUTF-8で出力
response.write('\ufeff')
writer = csv.writer(response)
# 全フィールドのヘッダー
writer.writerow([
'cp_number', 'cp_name', 'latitude', 'longitude', 'cp_point',
'photo_point', 'buy_point', 'address', 'phone', 'description'
'cp_number', 'cp_name', 'latitude', 'longitude', 'checkin_point',
'buy_point', 'address', 'phone', 'description',
'sub_loc_id', 'subcategory', 'photos', 'videos', 'tags',
'evaluation_value', 'remark', 'hidden_location'
])
queryset = self.get_queryset(request)
for obj in queryset:
writer.writerow([
obj.cp_number, obj.cp_name, obj.latitude, obj.longitude,
obj.cp_point, obj.photo_point, obj.buy_point,
obj.address, obj.phone, obj.description
obj.checkin_point, obj.buy_point,
obj.address or '', obj.phone or '', obj.description or '',
obj.sub_loc_id or '', obj.subcategory or '', obj.photos or '',
obj.videos or '', obj.tags or '', obj.evaluation_value or '',
obj.remark or '', obj.hidden_location
])
return response