Skip to content

Commit

Permalink
fixed some more blank=True without null=True and added migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
trombastic committed Jun 25, 2019
1 parent f514ea4 commit 094c766
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
28 changes: 28 additions & 0 deletions pyscada/migrations/0055_auto_20190625_1752.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-06-25 17:52
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('pyscada', '0054_auto_20190411_0749'),
]

operations = [
migrations.AlterModelOptions(
name='backgroundprocess',
options={'verbose_name_plural': 'Background Processes'},
),
migrations.AlterModelOptions(
name='variableproperty',
options={'verbose_name_plural': 'variable properties'},
),
migrations.AlterField(
model_name='variable',
name='cov_increment',
field=models.FloatField(default=0, verbose_name='COV'),
),
]
35 changes: 35 additions & 0 deletions pyscada/migrations/0056_auto_20190625_1823.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-06-25 18:23
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('pyscada', '0055_auto_20190625_1752'),
]

operations = [
migrations.AlterField(
model_name='backgroundprocess',
name='pid',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='event',
name='hysteresis',
field=models.FloatField(default=0),
),
migrations.AlterField(
model_name='mail',
name='send_fail_count',
field=models.PositiveSmallIntegerField(default=0),
),
migrations.AlterField(
model_name='mail',
name='timestamp',
field=models.FloatField(default=0),
),
]
8 changes: 4 additions & 4 deletions pyscada/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ def __str__(self):
@python_2_unicode_compatible
class BackgroundProcess(models.Model):
id = models.AutoField(primary_key=True)
pid = models.IntegerField(default=0, blank=True)
pid = models.IntegerField(default=0)
label = models.CharField(max_length=400, default='')
message = models.CharField(max_length=400, default='')
enabled = models.BooleanField(default=False, blank=True)
Expand Down Expand Up @@ -1390,7 +1390,7 @@ class Event(models.Model):
(4, 'value equals the limit'),
)
limit_type = models.PositiveSmallIntegerField(default=0, choices=limit_type_choices)
hysteresis = models.FloatField(default=0, blank=True)
hysteresis = models.FloatField(default=0)
action_choices = (
(0, 'just record'),
(1, 'record and send mail only when event occurs'),
Expand Down Expand Up @@ -1545,9 +1545,9 @@ class Mail(models.Model):
subject = models.TextField(default='', blank=True)
message = models.TextField(default='', blank=True)
to_email = models.EmailField(max_length=254)
timestamp = models.FloatField(default=0, blank=True) # TODO DateTimeField
timestamp = models.FloatField(default=0) # TODO DateTimeField
done = models.BooleanField(default=False, blank=True)
send_fail_count = models.PositiveSmallIntegerField(default=0, blank=True)
send_fail_count = models.PositiveSmallIntegerField(default=0)

def send_mail(self):
# TODO check email limit
Expand Down

0 comments on commit 094c766

Please sign in to comment.