update field types
This commit is contained in:
23
rog/migrations/0018_auto_20220816_1616.py
Normal file
23
rog/migrations/0018_auto_20220816_1616.py
Normal file
@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.2.9 on 2022-08-16 07:16
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0017_auto_20220725_1605'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='location',
|
||||
name='sub_loc_id',
|
||||
field=models.IntegerField(blank=True, null=True, verbose_name='Sub location id'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='cp',
|
||||
field=models.FloatField(blank=True, null=True, verbose_name='Check Point'),
|
||||
),
|
||||
]
|
||||
18
rog/migrations/0019_alter_location_checkin_radius.py
Normal file
18
rog/migrations/0019_alter_location_checkin_radius.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.9 on 2022-08-16 07:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0018_auto_20220816_1616'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='checkin_radius',
|
||||
field=models.FloatField(blank=True, default=15.0, null=True, verbose_name='Checkin radious'),
|
||||
),
|
||||
]
|
||||
23
rog/migrations/0020_auto_20220816_1627.py
Normal file
23
rog/migrations/0020_auto_20220816_1627.py
Normal file
@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.2.9 on 2022-08-16 07:27
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0019_alter_location_checkin_radius'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='buy_point',
|
||||
field=models.FloatField(blank=True, default=0, null=True, verbose_name='buy Point'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='checkin_point',
|
||||
field=models.FloatField(blank=True, default=10, null=True, verbose_name='Checkin Point'),
|
||||
),
|
||||
]
|
||||
@ -184,7 +184,8 @@ class SystemSettings(models.Model):
|
||||
|
||||
class Location(models.Model):
|
||||
location_id=models.IntegerField(_('Location id'), blank=True, null=True)
|
||||
cp=models.IntegerField(_('Check Point'), blank=True, null=True)
|
||||
sub_loc_id=models.IntegerField(_('Sub location id'), blank=True, null=True)
|
||||
cp=models.FloatField(_('Check Point'), blank=True, null=True)
|
||||
location_name=models.CharField(_('Location Name'), max_length=2048, default="--- 場所をお願いします --")
|
||||
category=models.CharField(_('Category'), max_length=2048, blank=True, null=True)
|
||||
subcategory=models.CharField(_('Sub Category'), max_length=2048, blank=True, null=True)
|
||||
@ -211,9 +212,9 @@ class Location(models.Model):
|
||||
event_active = models.BooleanField(_("Is Event active"),default=True)
|
||||
hidden_location = models.BooleanField(_("Is Hidden Location"),default=False)
|
||||
auto_checkin = models.BooleanField(_("Is AutoCheckin"),default=False)
|
||||
checkin_radius = models.IntegerField(_("Checkin radious"), blank=True, null=True, default=15)
|
||||
checkin_point = models.IntegerField(_("Checkin Point"), blank=True, null=True, default=10)
|
||||
buy_point = models.IntegerField(_("buy Point"), blank=True, null=True, default=0)
|
||||
checkin_radius = models.FloatField(_("Checkin radious"), blank=True, null=True, default=15.0)
|
||||
checkin_point = models.FloatField(_("Checkin Point"), blank=True, null=True, default=10)
|
||||
buy_point = models.FloatField(_("buy Point"), blank=True, null=True, default=0)
|
||||
evaluation_value = models.CharField(_('Evaluation value (評価)'),max_length=2048, blank=True, null=True)
|
||||
shop_closed = models.BooleanField(_("Shop Closed (休業)"),default=False)
|
||||
shop_shutdown = models.BooleanField(_("Shop Shutdown (閉業)"),default=False)
|
||||
@ -605,44 +606,45 @@ def updateLocation(mdl, fields):
|
||||
|
||||
with transaction.atomic():
|
||||
mdl.objects.filter(location_id = int(fields[0])).update(
|
||||
cp = fields[1] if len(fields[1]) > 1 else 0,
|
||||
location_name = fields[2] if len(fields[2]) > 1 else '',
|
||||
category = fields[3] if len(fields[3]) > 1 else '',
|
||||
subcategory = fields[4] if len(fields[4]) > 1 else '',
|
||||
zip = fields[5] if len(fields[5]) > 1 else '',
|
||||
address = fields[6] if len(fields[6]) > 1 else '',
|
||||
prefecture = fields[7] if len(fields[7]) > 1 else '',
|
||||
area = fields[8] if len(fields[8]) > 1 else '',
|
||||
city = fields[9] if len(fields[9]) > 1 else '',
|
||||
latitude = fields[10] if len(fields[10]) > 1 else '',
|
||||
longitude = fields[11] if len(fields[11]) > 1 else '',
|
||||
photos = fields[12] if len(fields[12]) > 1 else '',
|
||||
videos = fields[13] if len(fields[13]) > 1 else '',
|
||||
webcontents = fields[14] if len(fields[14]) > 1 else '',
|
||||
status = fields[15] if len(fields[15]) > 1 else '',
|
||||
portal = fields[16] if len(fields[16]) > 1 else '',
|
||||
group = fields[17] if len(fields[17]) > 1 else '',
|
||||
phone = fields[18] if len(fields[18]) > 1 else '',
|
||||
fax = fields[19] if len(fields[19]) > 1 else '',
|
||||
email = fields[20] if len(fields[20]) > 1 else '',
|
||||
facility = fields[21] if len(fields[21]) > 1 else '',
|
||||
remark = fields[22] if len(fields[22]) > 1 else '',
|
||||
tags = fields[23] if len(fields[23]) > 1 else '',
|
||||
hidden_location = fields[24] if len(fields[24]) > 1 else False,
|
||||
auto_checkin = fields[25] if len(fields[25]) > 1 else False,
|
||||
checkin_radius = fields[26] if len(fields[26]) > 1 else 15,
|
||||
checkin_point = fields[27] if len(fields[27]) > 1 else 10,
|
||||
buy_point = fields[28] if len(fields[28]) > 1 else 0,
|
||||
evaluation_value = fields[29] if len(fields[29]) > 1 else '',
|
||||
shop_closed = fields[30] if len(fields[30]) > 1 else False,
|
||||
shop_shutdown = fields[31] if len(fields[31]) > 1 else False,
|
||||
opening_hours_mon = fields[32] if len(fields[32]) > 1 else '',
|
||||
opening_hours_tue = fields[33] if len(fields[33]) > 1 else '',
|
||||
opening_hours_wed = fields[34] if len(fields[34]) > 1 else '',
|
||||
opening_hours_thu = fields[35] if len(fields[35]) > 1 else '',
|
||||
opening_hours_fri = fields[36] if len(fields[36]) > 1 else '',
|
||||
opening_hours_sat = fields[37] if len(fields[37]) > 1 else '',
|
||||
opening_hours_sun = fields[38] if len(fields[38]) > 1 else ''
|
||||
sub_loc_id = fields[1] if len(fields[1]) > 1 else 0,
|
||||
cp = fields[2] if len(fields[2]) > 1 else 0,
|
||||
location_name = fields[3] if len(fields[3]) > 1 else '',
|
||||
category = fields[4] if len(fields[4]) > 1 else '',
|
||||
subcategory = fields[5] if len(fields[5]) > 1 else '',
|
||||
zip = fields[6] if len(fields[6]) > 1 else '',
|
||||
address = fields[7] if len(fields[7]) > 1 else '',
|
||||
prefecture = fields[8] if len(fields[8]) > 1 else '',
|
||||
area = fields[9] if len(fields[9]) > 1 else '',
|
||||
city = fields[10] if len(fields[10]) > 1 else '',
|
||||
latitude = fields[11] if len(fields[11]) > 1 else '',
|
||||
longitude = fields[12] if len(fields[12]) > 1 else '',
|
||||
photos = fields[13] if len(fields[13]) > 1 else '',
|
||||
videos = fields[14] if len(fields[14]) > 1 else '',
|
||||
webcontents = fields[15] if len(fields[15]) > 1 else '',
|
||||
status = fields[16] if len(fields[16]) > 1 else '',
|
||||
portal = fields[17] if len(fields[17]) > 1 else '',
|
||||
group = fields[18] if len(fields[18]) > 1 else '',
|
||||
phone = fields[19] if len(fields[19]) > 1 else '',
|
||||
fax = fields[20] if len(fields[20]) > 1 else '',
|
||||
email = fields[21] if len(fields[21]) > 1 else '',
|
||||
facility = fields[22] if len(fields[22]) > 1 else '',
|
||||
remark = fields[23] if len(fields[23]) > 1 else '',
|
||||
tags = fields[24] if len(fields[24]) > 1 else '',
|
||||
hidden_location = fields[25] if len(fields[25]) > 1 else False,
|
||||
auto_checkin = fields[26] if len(fields[26]) > 1 else False,
|
||||
checkin_radius = fields[27] if len(fields[27]) > 1 else 15,
|
||||
checkin_point = fields[28] if len(fields[28]) > 1 else 10,
|
||||
buy_point = fields[29] if len(fields[29]) > 1 else 0,
|
||||
evaluation_value = fields[30] if len(fields[30]) > 1 else '',
|
||||
shop_closed = fields[31] if len(fields[31]) > 1 else False,
|
||||
shop_shutdown = fields[32] if len(fields[32]) > 1 else False,
|
||||
opening_hours_mon = fields[33] if len(fields[33]) > 1 else '',
|
||||
opening_hours_tue = fields[34] if len(fields[34]) > 1 else '',
|
||||
opening_hours_wed = fields[35] if len(fields[35]) > 1 else '',
|
||||
opening_hours_thu = fields[36] if len(fields[36]) > 1 else '',
|
||||
opening_hours_fri = fields[37] if len(fields[37]) > 1 else '',
|
||||
opening_hours_sat = fields[38] if len(fields[38]) > 1 else '',
|
||||
opening_hours_sun = fields[39] if len(fields[39]) > 1 else ''
|
||||
)
|
||||
|
||||
def updateLineTable(mdl, fields):
|
||||
|
||||
Reference in New Issue
Block a user