diff --git a/rog/admin.py b/rog/admin.py index 5d03f95..a28bfdf 100755 --- a/rog/admin.py +++ b/rog/admin.py @@ -1114,6 +1114,13 @@ class Location2025Admin(LeafletGeoAdmin): def evaluation_value_display(self, obj): """evaluation_valueのカスタム表示""" + # CP番号による特別な表示 + if obj.cp_number == -2: + return 'スタート' + elif obj.cp_number == -1: + return 'ゴール' + + # evaluation_valueによる通常の表示 evaluation_map = { '0': '通常CP', '1': '買物CP', diff --git a/rog/models.py b/rog/models.py index 1c7e556..0618fea 100755 --- a/rog/models.py +++ b/rog/models.py @@ -1236,6 +1236,21 @@ class Location2025(models.Model): hidden_str = row.get('hidden_location', '').lower() hidden_location = hidden_str in ['true', '1', 'yes', 'on'] + # checkin_radiusの処理 + checkin_radius = None + if row.get('checkin_radius'): + radius_str = row.get('checkin_radius', '').strip() + if radius_str and radius_str.lower() not in ['false', '', 'null']: + try: + checkin_radius = float(radius_str) + except ValueError: + # デフォルト値を設定 + checkin_radius = -1.0 # 要タップ + else: + checkin_radius = -1.0 # CSVでFALSEや空の場合は要タップ + else: + checkin_radius = -1.0 # デフォルトは要タップ + defaults = { # 基本フィールド 'cp_name': row.get('loc_name', row.get('cp_name', f'CP{cp_number}')), @@ -1247,6 +1262,7 @@ class Location2025(models.Model): 'address': row.get('address', ''), 'phone': row.get('phone', ''), 'description': row.get('description', row.get('remark', '')), + 'checkin_radius': checkin_radius, # チェックイン範囲を追加 # 新しいフィールド 'sub_loc_id': row.get('sub_loc_id', ''),