Update location2025 missing fields

This commit is contained in:
2025-08-31 15:04:35 +09:00
parent 619aa4f396
commit 104d39a96b
3 changed files with 54 additions and 4 deletions

View File

@ -1050,12 +1050,12 @@ class Location2025Admin(LeafletGeoAdmin):
] ]
list_filter = [ list_filter = [
'event', 'is_active', 'shop_closed', 'shop_shutdown', 'event', 'is_active', 'shop_closed', 'shop_shutdown',
'subcategory', 'hidden_location', 'category', 'subcategory', 'hidden_location',
'csv_upload_date', 'created_at' 'csv_upload_date', 'created_at'
] ]
search_fields = [ search_fields = [
'cp_name', 'address', 'description', 'remark', 'tags', 'cp_name', 'address', 'description', 'remark', 'tags',
'sub_loc_id', 'subcategory', 'evaluation_value', 'sub_loc_id', 'category', 'subcategory', 'evaluation_value',
'event__event_name' # イベント名での検索を追加 'event__event_name' # イベント名での検索を追加
] ]
readonly_fields = [ readonly_fields = [
@ -1065,7 +1065,7 @@ class Location2025Admin(LeafletGeoAdmin):
fieldsets = ( fieldsets = (
('基本情報', { ('基本情報', {
'fields': ('cp_number', 'event', 'cp_name', 'sub_loc_id', 'subcategory', 'is_active', 'sort_order') 'fields': ('cp_number', 'event', 'cp_name', 'category', 'sub_loc_id', 'subcategory', 'is_active', 'sort_order')
}), }),
('位置情報', { ('位置情報', {
'fields': ('latitude', 'longitude', 'location', 'address', 'zip_code', 'prefecture', 'area', 'city') 'fields': ('latitude', 'longitude', 'location', 'address', 'zip_code', 'prefecture', 'area', 'city')

View File

@ -0,0 +1,43 @@
# Generated manually on 2025-08-31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rog', '0011_auto_20250830_0426'),
]
operations = [
migrations.AddField(
model_name='location2025',
name='area',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='地域'),
),
migrations.AddField(
model_name='location2025',
name='category',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='カテゴリ'),
),
migrations.AddField(
model_name='location2025',
name='city',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='市区町村'),
),
migrations.AddField(
model_name='location2025',
name='facility',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='設備'),
),
migrations.AddField(
model_name='location2025',
name='prefecture',
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='都道府県'),
),
migrations.AddField(
model_name='location2025',
name='zip_code',
field=models.CharField(blank=True, max_length=12, null=True, verbose_name='郵便番号'),
),
]

View File

@ -1091,6 +1091,7 @@ class Location2025(models.Model):
cp_number = models.IntegerField(_('CP番号'), db_index=True) cp_number = models.IntegerField(_('CP番号'), db_index=True)
event = models.ForeignKey('NewEvent2', on_delete=models.CASCADE, verbose_name=_('イベント')) event = models.ForeignKey('NewEvent2', on_delete=models.CASCADE, verbose_name=_('イベント'))
cp_name = models.CharField(_('CP名'), max_length=255) cp_name = models.CharField(_('CP名'), max_length=255)
category = models.CharField(_('カテゴリ'), max_length=255, blank=True, null=True)
sub_loc_id = models.CharField(_('サブロケーションID'), max_length=2048, blank=True, null=True) sub_loc_id = models.CharField(_('サブロケーションID'), max_length=2048, blank=True, null=True)
subcategory = models.CharField(_('サブカテゴリ'), max_length=2048, blank=True, null=True) subcategory = models.CharField(_('サブカテゴリ'), max_length=2048, blank=True, null=True)
@ -1114,8 +1115,13 @@ class Location2025(models.Model):
# 詳細情報 # 詳細情報
address = models.CharField(_('住所'), max_length=512, blank=True, null=True) address = models.CharField(_('住所'), max_length=512, blank=True, null=True)
zip_code = models.CharField(_('郵便番号'), max_length=12, blank=True, null=True)
prefecture = models.CharField(_('都道府県'), max_length=255, blank=True, null=True)
area = models.CharField(_('地域'), max_length=255, blank=True, null=True)
city = models.CharField(_('市区町村'), max_length=255, blank=True, null=True)
phone = models.CharField(_('電話番号'), max_length=32, blank=True, null=True) phone = models.CharField(_('電話番号'), max_length=32, blank=True, null=True)
website = models.URLField(_('ウェブサイト'), blank=True, null=True) website = models.URLField(_('ウェブサイト'), blank=True, null=True)
facility = models.CharField(_('設備'), max_length=255, blank=True, null=True)
description = models.TextField(_('説明'), blank=True, null=True) description = models.TextField(_('説明'), blank=True, null=True)
# 追加フィールドLocationテーブルから移行 # 追加フィールドLocationテーブルから移行
@ -1265,8 +1271,9 @@ class Location2025(models.Model):
'checkin_radius': checkin_radius, # チェックイン範囲を追加 'checkin_radius': checkin_radius, # チェックイン範囲を追加
# 新しいフィールド # 新しいフィールド
'category': row.get('category', ''),
'sub_loc_id': row.get('sub_loc_id', ''), 'sub_loc_id': row.get('sub_loc_id', ''),
'subcategory': row.get('subcategory', row.get('category', '')), 'subcategory': row.get('subcategory', ''),
'photos': row.get('photos', ''), 'photos': row.get('photos', ''),
'videos': row.get('videos', ''), 'videos': row.get('videos', ''),
'tags': row.get('tags', ''), 'tags': row.get('tags', ''),