feat: carwash增加返回记录
This commit is contained in:
parent
bb05ba8c5c
commit
666d317f01
|
@ -163,6 +163,8 @@ class EnvDataExportSerializer(serializers.Serializer):
|
|||
|
||||
|
||||
class CarWashSerializer(CustomModelSerializer):
|
||||
station_name = serializers.CharField(source='station.name', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = CarWash
|
||||
fields = "__all__"
|
||||
|
|
|
@ -138,6 +138,7 @@ class CarWashViewSet(ListModelMixin, CustomGenericViewSet):
|
|||
perms_map = {'get': '*'}
|
||||
queryset = CarWash.objects.all()
|
||||
serializer_class = CarWashSerializer
|
||||
select_related_fields = ['station']
|
||||
filterset_fields = {
|
||||
"station": ['exact'],
|
||||
"start_time": ['exact', 'gte', 'lte', 'year', 'month', 'day'],
|
||||
|
|
Loading…
Reference in New Issue