From 53117c838be417ca219406085f7bae852f8a1b21 Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 12 Sep 2025 14:18:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20ofm-=E6=A1=A3=E6=A1=88=E7=AE=A1?= =?UTF-8?q?=E7=90=86-serializer=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ofm/serializers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/ofm/serializers.py b/apps/ofm/serializers.py index bca706bf..66d053a2 100644 --- a/apps/ofm/serializers.py +++ b/apps/ofm/serializers.py @@ -95,7 +95,6 @@ class BorrowRecordSerializer(CustomModelSerializer): create_by_name = serializers.CharField(source='create_by.name', read_only=True) belong_dept_name = serializers.CharField(source='belong_dept.name', read_only=True) files = serializers.PrimaryKeyRelatedField(queryset=FileRecord.objects.all(), many=True, write_only=True, label="借阅文件") - file_detail = FileRecordSerializer(source='borrow_file', many=True, read_only=True, label="借阅文件详情") class Meta: model = BorrowRecord fields = '__all__' From 8bcd9b7d035e2f7b2776b4c6177dcb385687a51b Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 12 Sep 2025 14:32:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:ofm=20-=20=E6=A1=A3=E6=A1=88=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=BF=AE=E6=94=B9=20serializer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ofm/serializers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ofm/serializers.py b/apps/ofm/serializers.py index 66d053a2..c02cf4f1 100644 --- a/apps/ofm/serializers.py +++ b/apps/ofm/serializers.py @@ -94,7 +94,8 @@ class FileRecordSerializer(CustomModelSerializer): class BorrowRecordSerializer(CustomModelSerializer): create_by_name = serializers.CharField(source='create_by.name', read_only=True) belong_dept_name = serializers.CharField(source='belong_dept.name', read_only=True) - files = serializers.PrimaryKeyRelatedField(queryset=FileRecord.objects.all(), many=True, write_only=True, label="借阅文件") + borrow_file = serializers.PrimaryKeyRelatedField(queryset=FileRecord.objects.all(), many=True, write_only=True, label="借阅文件") + file_detail = FileRecordSerializer(source='borrow_file', many=True, read_only=True, label="借阅文件详情") class Meta: model = BorrowRecord fields = '__all__' From 643c45882fe39d3bf96cbb67d5484395132ad510 Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 12 Sep 2025 14:43:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20ofm-=E4=BF=AE=E6=94=B9=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0008_remove_borrowrecord_borrow_user.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 apps/ofm/migrations/0008_remove_borrowrecord_borrow_user.py diff --git a/apps/ofm/migrations/0008_remove_borrowrecord_borrow_user.py b/apps/ofm/migrations/0008_remove_borrowrecord_borrow_user.py new file mode 100644 index 00000000..e8bfb234 --- /dev/null +++ b/apps/ofm/migrations/0008_remove_borrowrecord_borrow_user.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.12 on 2025-09-12 06:42 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ofm', '0007_auto_20250911_1441'), + ] + + operations = [ + migrations.RemoveField( + model_name='borrowrecord', + name='borrow_user', + ), + ]