Commit 4c6d31a4 authored by Alan Mitchell's avatar Alan Mitchell

Disallow no Sensor unit selection.

parent b2d0d70e
# Generated by Django 2.1.7 on 2019-09-10 04:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bmsapp', '0030_auto_20190812_1639'),
]
operations = [
migrations.AlterField(
model_name='sensor',
name='unit',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.SET_DEFAULT, to='bmsapp.Unit'),
),
]
......@@ -65,7 +65,8 @@ class Sensor(models.Model):
title = models.CharField(max_length = 80)
# the units for the sensor values
unit = models.ForeignKey(Unit, models.SET_NULL, blank=True, null=True)
# Does not allow no value.
unit = models.ForeignKey(Unit, models.SET_DEFAULT, default=1)
# Adds in a notes field to the Current sensors page.
notes = models.TextField("Please enter descriptive notes about the sensor.", default="No sensor notes available.")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment