From e690e0b420b9ef675282ec36c7abf0fc499b44d1 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Mon, 22 Aug 2022 19:50:51 +0530 Subject: [PATCH] add default to cp field --- rog/migrations/0022_auto_20220822_2319.py | 23 +++++++++++++++++++++++ rog/migrations/0023_alter_location_cp.py | 18 ++++++++++++++++++ rog/models.py | 4 ++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 rog/migrations/0022_auto_20220822_2319.py create mode 100644 rog/migrations/0023_alter_location_cp.py diff --git a/rog/migrations/0022_auto_20220822_2319.py b/rog/migrations/0022_auto_20220822_2319.py new file mode 100644 index 0000000..c261dbc --- /dev/null +++ b/rog/migrations/0022_auto_20220822_2319.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.9 on 2022-08-22 14:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('rog', '0021_templocation'), + ] + + operations = [ + migrations.AlterField( + model_name='shapelayers', + name='layerof', + field=models.IntegerField(choices=[(1, 'templocation'), (2, 'Location_line'), (3, 'Location_polygon')], default=1), + ), + migrations.AlterField( + model_name='templocation', + name='cp', + field=models.FloatField(default=0, null=True, verbose_name='Check Point'), + ), + ] diff --git a/rog/migrations/0023_alter_location_cp.py b/rog/migrations/0023_alter_location_cp.py new file mode 100644 index 0000000..fb24c06 --- /dev/null +++ b/rog/migrations/0023_alter_location_cp.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.9 on 2022-08-22 14:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('rog', '0022_auto_20220822_2319'), + ] + + operations = [ + migrations.AlterField( + model_name='location', + name='cp', + field=models.FloatField(default=0, null=True, verbose_name='Check Point'), + ), + ] diff --git a/rog/models.py b/rog/models.py index 6e7036d..c3141ac 100644 --- a/rog/models.py +++ b/rog/models.py @@ -185,7 +185,7 @@ class SystemSettings(models.Model): class Location(models.Model): location_id=models.IntegerField(_('Location id'), 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) + cp=models.FloatField(_('Check Point'), blank=False, null=True, default=0) 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) @@ -238,7 +238,7 @@ class Location(models.Model): class templocation(models.Model): location_id=models.IntegerField(_('Location id'), 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) + cp=models.FloatField(_('Check Point'), blank=False, null=True, default=0) 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)