update for location fields
This commit is contained in:
57
rog/migrations/0015_auto_20220619_1611.py
Normal file
57
rog/migrations/0015_auto_20220619_1611.py
Normal file
@ -0,0 +1,57 @@
|
||||
# Generated by Django 3.2.9 on 2022-06-19 07:11
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('rog', '0014_alter_location_shop_shutdown'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='location',
|
||||
name='checkin_radious',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_fri',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours frinday (金曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_mon',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours monday (月曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_sat',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours saturday (土曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_sun',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours sunday (日曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_thu',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours thursday (木曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_tue',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours tuesday (火曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='opening_hours_wed',
|
||||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Opening hours wednesday (水曜)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='location',
|
||||
name='photos',
|
||||
field=models.CharField(blank=True, max_length=2048, null=True, verbose_name='Photos'),
|
||||
),
|
||||
]
|
||||
@ -189,7 +189,7 @@ class Location(models.Model):
|
||||
city= models.CharField(_('City'), max_length=2048, blank=True, null=True)
|
||||
latitude = models.FloatField('Latitude', blank=True, null=True)
|
||||
longitude = models.FloatField('Latitude', blank=True, null=True)
|
||||
photos=models.CharField(_('Phptos'), max_length=2048, blank=True, null=True)
|
||||
photos=models.CharField(_('Photos'), max_length=2048, blank=True, null=True)
|
||||
videos=models.CharField(_('Videos'), max_length=2048, blank=True, null=True)
|
||||
webcontents=models.CharField(_('Web Content'), max_length=2048, blank=True, null=True)
|
||||
status=models.CharField(_('Status'),max_length=2048, blank=True, null=True)
|
||||
@ -211,14 +211,13 @@ class Location(models.Model):
|
||||
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)
|
||||
opening_hours_mon = models.TimeField(_("Opening hours monday (月曜)"), blank=True, null=True)
|
||||
opening_hours_tue = models.TimeField(_("Opening hours tuesday (火曜)"), blank=True, null=True)
|
||||
opening_hours_wed = models.TimeField(_("Opening hours wednesday (水曜)"), blank=True, null=True)
|
||||
opening_hours_thu = models.TimeField(_("Opening hours thursday (木曜)"), blank=True, null=True)
|
||||
opening_hours_fri = models.TimeField(_("Opening hours frinday (金曜)"), blank=True, null=True)
|
||||
opening_hours_sat = models.TimeField(_("Opening hours saturday (土曜)"), blank=True, null=True)
|
||||
opening_hours_sun = models.TimeField(_("Opening hours sunday (日曜)"), blank=True, null=True)
|
||||
checkin_radious = models.IntegerField(_("Checkin Radious"), blank=True, null=True)
|
||||
opening_hours_mon = models.CharField(_("Opening hours monday (月曜)"),max_length=512, blank=True, null=True)
|
||||
opening_hours_tue = models.CharField(_("Opening hours tuesday (火曜)"), max_length=512,blank=True, null=True)
|
||||
opening_hours_wed = models.CharField(_("Opening hours wednesday (水曜)"), max_length=512,blank=True, null=True)
|
||||
opening_hours_thu = models.CharField(_("Opening hours thursday (木曜)"), max_length=512, blank=True, null=True)
|
||||
opening_hours_fri = models.CharField(_("Opening hours frinday (金曜)"), max_length=512,blank=True, null=True)
|
||||
opening_hours_sat = models.CharField(_("Opening hours saturday (土曜)"), max_length=512,blank=True, null=True)
|
||||
opening_hours_sun = models.CharField(_("Opening hours sunday (日曜)"),max_length=512, blank=True, null=True)
|
||||
parammeters=models.CharField(_('Parameters'), max_length=2048, blank=True, null=True)
|
||||
created_at=models.DateTimeField(auto_now_add=True)
|
||||
last_updated_user=models.ForeignKey(CustomUser, related_name="location_updated_user", on_delete=models.DO_NOTHING,blank=True, null=True)
|
||||
@ -567,28 +566,41 @@ def updateLocation(mdl, fields):
|
||||
|
||||
with transaction.atomic():
|
||||
mdl.objects.filter(location_id = int(fields[0])).update(
|
||||
location_name = fields[1] if len(fields) > 1 else '',
|
||||
category = fields[2] if len(fields) > 1 else '',
|
||||
zip = fields[3] if len(fields) > 1 else '',
|
||||
address = fields[4] if len(fields) > 1 else '',
|
||||
prefecture = fields[5] if len(fields) > 1 else '',
|
||||
area = fields[6] if len(fields) > 1 else '',
|
||||
city = fields[7] if len(fields) > 1 else '',
|
||||
latitude = fields[8] if len(fields) > 1 else '',
|
||||
longitude = fields[9] if len(fields) > 1 else '',
|
||||
photos = fields[10] if len(fields) > 1 else '',
|
||||
videos = fields[11] if len(fields) > 1 else '',
|
||||
webcontents = fields[12] if len(fields) > 1 else '',
|
||||
status = fields[13] if len(fields) > 1 else '',
|
||||
portal = fields[14] if len(fields) > 1 else '',
|
||||
group = fields[15] if len(fields) > 1 else '',
|
||||
phone = fields[16] if len(fields) > 1 else '',
|
||||
fax = fields[17] if len(fields) > 1 else '',
|
||||
email = fields[18] if len(fields) > 1 else '',
|
||||
facility = fields[19] if len(fields) > 1 else '',
|
||||
remark = fields[20] if len(fields) > 1 else '',
|
||||
parammeters = fields[21] if len(fields) > 1 else '',
|
||||
tags = fields[22] if len(fields) > 1 else ''
|
||||
location_name = fields[1] if len(fields[1]) > 1 else '',
|
||||
category = fields[2] if len(fields[2]) > 1 else '',
|
||||
zip = fields[3] if len(fields[3]) > 1 else '',
|
||||
address = fields[4] if len(fields[4]) > 1 else '',
|
||||
prefecture = fields[5] if len(fields[5]) > 1 else '',
|
||||
area = fields[6] if len(fields[6]) > 1 else '',
|
||||
city = fields[7] if len(fields[7]) > 1 else '',
|
||||
latitude = fields[8] if len(fields[8]) > 1 else '',
|
||||
longitude = fields[9] if len(fields[9]) > 1 else '',
|
||||
photos = fields[10] if len(fields[10]) > 1 else '',
|
||||
videos = fields[11] if len(fields[11]) > 1 else '',
|
||||
webcontents = fields[12] if len(fields[12]) > 1 else '',
|
||||
status = fields[13] if len(fields[13]) > 1 else '',
|
||||
portal = fields[14] if len(fields[14]) > 1 else '',
|
||||
group = fields[15] if len(fields[15]) > 1 else '',
|
||||
phone = fields[16] if len(fields[16]) > 1 else '',
|
||||
fax = fields[17] if len(fields[17]) > 1 else '',
|
||||
email = fields[18] if len(fields[18]) > 1 else '',
|
||||
facility = fields[19] if len(fields[19]) > 1 else '',
|
||||
remark = fields[20] if len(fields[20]) > 1 else '',
|
||||
tags = fields[21] if len(fields[21]) > 1 else '',
|
||||
hidden_location = fields[22] if len(fields[22]) > 1 else False,
|
||||
auto_checkin = fields[23] if len(fields[23]) > 1 else False,
|
||||
checkin_radius = fields[24] if len(fields[24]) > 1 else 15,
|
||||
checkin_point = fields[25] if len(fields[25]) > 1 else 10,
|
||||
buy_point = fields[26] if len(fields[26]) > 1 else 0,
|
||||
evaluation_value = fields[27] if len(fields[27]) > 1 else '',
|
||||
shop_closed = fields[28] if len(fields[28]) > 1 else False,
|
||||
shop_shutdown = fields[29] if len(fields[29]) > 1 else False,
|
||||
opening_hours_mon = fields[30] if len(fields[30]) > 1 else '',
|
||||
opening_hours_tue = fields[31] if len(fields[31]) > 1 else '',
|
||||
opening_hours_wed = fields[32] if len(fields[32]) > 1 else '',
|
||||
opening_hours_thu = fields[33] if len(fields[33]) > 1 else '',
|
||||
opening_hours_fri = fields[34] if len(fields[34]) > 1 else '',
|
||||
opening_hours_sat = fields[35] if len(fields[35]) > 1 else ''
|
||||
)
|
||||
|
||||
def updateLineTable(mdl, fields):
|
||||
|
||||
Reference in New Issue
Block a user