feat: 添加是否新能源字段

This commit is contained in:
caoqianming 2024-03-13 17:39:23 +08:00
parent a891692b71
commit 718f594a4b
3 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2024-03-12 08:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('enp', '0007_auto_20240228_1618'),
]
operations = [
migrations.AddField(
model_name='vehicleaccess',
name='is_new_energy',
field=models.BooleanField(default=False, verbose_name='是否新能源'),
),
]

View File

@ -124,6 +124,7 @@ class VehicleAccess(BaseModel):
access_time = models.DateTimeField('出入时间', null=True, blank=True)
emission_standard = models.CharField(
'排放标准', max_length=10, null=True, blank=True)
is_new_energy = models.BooleanField('是否新能源', default=False)
door_name = models.CharField('门禁名称', max_length=10, null=True, blank=True)

View File

@ -104,6 +104,7 @@ class VehicleAccessViewSet(ListModelMixin, CustomGenericViewSet):
"vehicle_number": ['icontains'],
"emission_standard": ['exact', 'in'],
"type": ['exact', 'in'],
"is_new_energy": ["exact"],
"access_time": ['gte', 'lte', 'year', 'month', 'day', 'quarter', 'week']
}