add location migrate
This commit is contained in:
@ -1002,7 +1002,8 @@ admin.site.register(EventUser, admin.ModelAdmin)
|
||||
#admin.site.register(ShapeFileLocations, admin.ModelAdmin)
|
||||
|
||||
#admin.site.register(CustomUser, UserAdminConfig)
|
||||
admin.site.register(templocation, TempLocationAdmin)
|
||||
# 古いtemplocationは無効化 - Location2025を使用
|
||||
#admin.site.register(templocation, TempLocationAdmin)
|
||||
admin.site.register(GoalImages, admin.ModelAdmin)
|
||||
admin.site.register(CheckinImages, admin.ModelAdmin)
|
||||
|
||||
@ -1130,9 +1131,10 @@ class Location2025Admin(LeafletGeoAdmin):
|
||||
|
||||
return redirect('..')
|
||||
|
||||
# フォーム表示
|
||||
# フォーム表示 - Location2025システム用
|
||||
from .models import NewEvent2
|
||||
events = NewEvent2.objects.filter(event_active=True).order_by('-created_at')
|
||||
# statusフィールドベースでアクティブなイベントを取得
|
||||
events = NewEvent2.objects.filter(status='public').order_by('-start_datetime')
|
||||
|
||||
return render(request, 'admin/location2025/upload_csv.html', {
|
||||
'events': events,
|
||||
|
||||
22
rog/migrations/0008_add_status_field.py
Normal file
22
rog/migrations/0008_add_status_field.py
Normal file
@ -0,0 +1,22 @@
|
||||
# Generated manually to add status field to NewEvent2
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0007_auto_20250829_1836'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='newevent2',
|
||||
name='status',
|
||||
field=models.CharField(
|
||||
choices=[('public', 'Public'), ('private', 'Private'), ('draft', 'Draft'), ('closed', 'Closed')],
|
||||
default='draft',
|
||||
help_text='イベントステータス',
|
||||
max_length=20
|
||||
),
|
||||
),
|
||||
]
|
||||
34
rog/migrations/0009_add_fields_to_models.py
Normal file
34
rog/migrations/0009_add_fields_to_models.py
Normal file
@ -0,0 +1,34 @@
|
||||
# Generated manually to add missing timestamp fields to gpscheckin
|
||||
from django.db import migrations, models
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0008_add_status_field'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='gpscheckin',
|
||||
name='created_at',
|
||||
field=models.DateTimeField(auto_now_add=True, default=timezone.now),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gpscheckin',
|
||||
name='updated_at',
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='sub_loc_id',
|
||||
field=models.CharField(blank=True, max_length=2048, null=True, verbose_name='サブロケーションID'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='subcategory',
|
||||
field=models.CharField(blank=True, max_length=2048, null=True, verbose_name='サブカテゴリ'),
|
||||
),
|
||||
]
|
||||
43
rog/migrations/0010_add_missing_fields_to_location2025.py
Normal file
43
rog/migrations/0010_add_missing_fields_to_location2025.py
Normal file
@ -0,0 +1,43 @@
|
||||
# Generated manually on 2025-08-30
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0009_add_fields_to_models'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='photos',
|
||||
field=models.CharField(max_length=2048, blank=True, null=True, verbose_name='写真'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='videos',
|
||||
field=models.CharField(max_length=2048, blank=True, null=True, verbose_name='動画'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='remark',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='備考'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='tags',
|
||||
field=models.CharField(max_length=2048, blank=True, null=True, verbose_name='タグ'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='evaluation_value',
|
||||
field=models.CharField(max_length=255, blank=True, null=True, verbose_name='評価値'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='location2025',
|
||||
name='hidden_location',
|
||||
field=models.BooleanField(default=False, verbose_name='隠しロケーション'),
|
||||
),
|
||||
]
|
||||
0
rog/migrations/__init__.py
Normal file
0
rog/migrations/__init__.py
Normal file
@ -1091,6 +1091,8 @@ 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)
|
||||
sub_loc_id = models.CharField(_('サブロケーションID'), max_length=2048, blank=True, null=True)
|
||||
subcategory = models.CharField(_('サブカテゴリ'), max_length=2048, blank=True, null=True)
|
||||
|
||||
# 位置情報
|
||||
latitude = models.FloatField(_('緯度'), null=True, blank=True)
|
||||
@ -1117,6 +1119,14 @@ class Location2025(models.Model):
|
||||
website = models.URLField(_('ウェブサイト'), blank=True, null=True)
|
||||
description = models.TextField(_('説明'), blank=True, null=True)
|
||||
|
||||
# 追加フィールド(Locationテーブルから移行)
|
||||
photos = models.CharField(_('写真'), max_length=2048, blank=True, null=True)
|
||||
videos = models.CharField(_('動画'), max_length=2048, blank=True, null=True)
|
||||
remark = models.TextField(_('備考'), blank=True, null=True)
|
||||
tags = models.CharField(_('タグ'), max_length=2048, blank=True, null=True)
|
||||
evaluation_value = models.CharField(_('評価値'), max_length=255, blank=True, null=True)
|
||||
hidden_location = models.BooleanField(_('隠しロケーション'), default=False)
|
||||
|
||||
# 管理情報
|
||||
is_active = models.BooleanField(_('有効'), default=True, db_index=True)
|
||||
sort_order = models.IntegerField(_('表示順'), default=0)
|
||||
|
||||
Reference in New Issue
Block a user