设备覆盖区字段非必填

This commit is contained in:
曹前明 2022-08-25 17:35:34 +08:00
parent 26d9c0ee70
commit 26a8ca05d1
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 3.2.12 on 2022-08-25 09:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('am', '0002_initial'),
('third', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='tdevice',
name='areas',
field=models.ManyToManyField(blank=True, related_name='tareas', to='am.Area', verbose_name='覆盖区'),
),
]

View File

@ -38,7 +38,7 @@ class TDevice(BaseModel):
area = models.ForeignKey(Area, on_delete=models.SET_NULL,
verbose_name='所在区', null=True, blank=True)
areas = models.ManyToManyField(Area, verbose_name='覆盖区',
related_name='tareas')
related_name='tareas', blank=True)
obj_cate = models.CharField('绑定对象', max_length=20, help_text='people/...', null=True, blank=True)
employee = models.OneToOneField(Employee, verbose_name='当前绑定人员', on_delete=models.SET_NULL,
null=True, blank=True)