From 26a8ca05d1f614600e77efa9719a2acc5b0313a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Thu, 25 Aug 2022 17:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E8=A6=86=E7=9B=96=E5=8C=BA?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E9=9D=9E=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0002_alter_tdevice_areas.py | 19 +++++++++++++++++++ apps/third/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/third/migrations/0002_alter_tdevice_areas.py diff --git a/apps/third/migrations/0002_alter_tdevice_areas.py b/apps/third/migrations/0002_alter_tdevice_areas.py new file mode 100644 index 00000000..c2365b6d --- /dev/null +++ b/apps/third/migrations/0002_alter_tdevice_areas.py @@ -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='覆盖区'), + ), + ] diff --git a/apps/third/models.py b/apps/third/models.py index aa4e2f26..8748e032 100755 --- a/apps/third/models.py +++ b/apps/third/models.py @@ -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)