Skip to content

Commit 094c766

Browse files
committed
fixed some more blank=True without null=True and added migrations
1 parent f514ea4 commit 094c766

3 files changed

Lines changed: 67 additions & 4 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.15 on 2019-06-25 17:52
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('pyscada', '0054_auto_20190411_0749'),
12+
]
13+
14+
operations = [
15+
migrations.AlterModelOptions(
16+
name='backgroundprocess',
17+
options={'verbose_name_plural': 'Background Processes'},
18+
),
19+
migrations.AlterModelOptions(
20+
name='variableproperty',
21+
options={'verbose_name_plural': 'variable properties'},
22+
),
23+
migrations.AlterField(
24+
model_name='variable',
25+
name='cov_increment',
26+
field=models.FloatField(default=0, verbose_name='COV'),
27+
),
28+
]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.15 on 2019-06-25 18:23
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('pyscada', '0055_auto_20190625_1752'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='backgroundprocess',
17+
name='pid',
18+
field=models.IntegerField(default=0),
19+
),
20+
migrations.AlterField(
21+
model_name='event',
22+
name='hysteresis',
23+
field=models.FloatField(default=0),
24+
),
25+
migrations.AlterField(
26+
model_name='mail',
27+
name='send_fail_count',
28+
field=models.PositiveSmallIntegerField(default=0),
29+
),
30+
migrations.AlterField(
31+
model_name='mail',
32+
name='timestamp',
33+
field=models.FloatField(default=0),
34+
),
35+
]

pyscada/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ def __str__(self):
12651265
@python_2_unicode_compatible
12661266
class BackgroundProcess(models.Model):
12671267
id = models.AutoField(primary_key=True)
1268-
pid = models.IntegerField(default=0, blank=True)
1268+
pid = models.IntegerField(default=0)
12691269
label = models.CharField(max_length=400, default='')
12701270
message = models.CharField(max_length=400, default='')
12711271
enabled = models.BooleanField(default=False, blank=True)
@@ -1390,7 +1390,7 @@ class Event(models.Model):
13901390
(4, 'value equals the limit'),
13911391
)
13921392
limit_type = models.PositiveSmallIntegerField(default=0, choices=limit_type_choices)
1393-
hysteresis = models.FloatField(default=0, blank=True)
1393+
hysteresis = models.FloatField(default=0)
13941394
action_choices = (
13951395
(0, 'just record'),
13961396
(1, 'record and send mail only when event occurs'),
@@ -1545,9 +1545,9 @@ class Mail(models.Model):
15451545
subject = models.TextField(default='', blank=True)
15461546
message = models.TextField(default='', blank=True)
15471547
to_email = models.EmailField(max_length=254)
1548-
timestamp = models.FloatField(default=0, blank=True) # TODO DateTimeField
1548+
timestamp = models.FloatField(default=0) # TODO DateTimeField
15491549
done = models.BooleanField(default=False, blank=True)
1550-
send_fail_count = models.PositiveSmallIntegerField(default=0, blank=True)
1550+
send_fail_count = models.PositiveSmallIntegerField(default=0)
15511551

15521552
def send_mail(self):
15531553
# TODO check email limit

0 commit comments

Comments
 (0)