diff --git a/rog/admin.py b/rog/admin.py index 9071530..b59e5f4 100755 --- a/rog/admin.py +++ b/rog/admin.py @@ -1050,12 +1050,12 @@ class Location2025Admin(LeafletGeoAdmin): ] list_filter = [ 'event', 'is_active', 'shop_closed', 'shop_shutdown', - 'subcategory', 'hidden_location', + 'category', 'subcategory', 'hidden_location', 'csv_upload_date', 'created_at' ] search_fields = [ 'cp_name', 'address', 'description', 'remark', 'tags', - 'sub_loc_id', 'subcategory', 'evaluation_value', + 'sub_loc_id', 'category', 'subcategory', 'evaluation_value', 'event__event_name' # イベント名での検索を追加 ] readonly_fields = [ @@ -1065,7 +1065,7 @@ class Location2025Admin(LeafletGeoAdmin): 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') diff --git a/rog/migrations/0012_location2025_add_missing_fields.py b/rog/migrations/0012_location2025_add_missing_fields.py new file mode 100644 index 0000000..6a7e068 --- /dev/null +++ b/rog/migrations/0012_location2025_add_missing_fields.py @@ -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='郵便番号'), + ), + ] diff --git a/rog/models.py b/rog/models.py index b0ac7b5..7c9794c 100755 --- a/rog/models.py +++ b/rog/models.py @@ -1091,6 +1091,7 @@ class Location2025(models.Model): cp_number = models.IntegerField(_('CP番号'), db_index=True) event = models.ForeignKey('NewEvent2', on_delete=models.CASCADE, verbose_name=_('イベント')) 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) 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) + 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) website = models.URLField(_('ウェブサイト'), blank=True, null=True) + facility = models.CharField(_('設備'), max_length=255, blank=True, null=True) description = models.TextField(_('説明'), blank=True, null=True) # 追加フィールド(Locationテーブルから移行) @@ -1265,8 +1271,9 @@ class Location2025(models.Model): 'checkin_radius': checkin_radius, # チェックイン範囲を追加 # 新しいフィールド + 'category': row.get('category', ''), 'sub_loc_id': row.get('sub_loc_id', ''), - 'subcategory': row.get('subcategory', row.get('category', '')), + 'subcategory': row.get('subcategory', ''), 'photos': row.get('photos', ''), 'videos': row.get('videos', ''), 'tags': row.get('tags', ''),