feat: equipment增加power_kw字段
This commit is contained in:
parent
f62344509f
commit
673fd0501c
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.12 on 2023-06-30 09:00
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('em', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='equipment',
|
||||
name='power_kw',
|
||||
field=models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='功率'),
|
||||
),
|
||||
]
|
|
@ -63,6 +63,7 @@ class Equipment(CommonBModel):
|
|||
cycle = models.PositiveSmallIntegerField('校准或检定周期(月)', null=True, blank=True)
|
||||
check_date = models.DateField('最近校准检查日期', blank=True, null=True)
|
||||
next_check_date = models.DateField('预计下次校准检查日期',blank=True, null=True)
|
||||
power_kw = models.PositiveSmallIntegerField('功率', null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = '设备信息'
|
||||
|
|
|
@ -6,8 +6,8 @@ from rest_framework import serializers
|
|||
|
||||
class EquipmentSerializer(CustomModelSerializer):
|
||||
belong_dept = serializers.PrimaryKeyRelatedField(label='责任部门', queryset = Dept.objects.all())
|
||||
keeper_name = serializers.CharField(source='keeper.name')
|
||||
belong_dept_name = serializers.CharField(source='belong_dept.name')
|
||||
keeper_name = serializers.CharField(source='keeper.name', read_only=True)
|
||||
belong_dept_name = serializers.CharField(source='belong_dept.name', read_only=True)
|
||||
class Meta:
|
||||
model = Equipment
|
||||
fields = '__all__'
|
||||
|
|
Loading…
Reference in New Issue