Tag:Outreach

  • 13 difference between serializer and modelserializer

    Time:2021-10-6

    1、 Modelserializer serialization1. Define modelserializer serializer Design and declare serialization classes for models from rest_framework import serializers from .models import Book, Publisher class BookSerializer(serializers.ModelSerializer): class Meta:Model = Book # corresponds to the book table #These three cases cannot be used at the same time #1. Get all fields fields = “__all__” #2. Custom include fields […]

  • Object comparison

    Time:2020-10-13

    Object comparison proposition When updating the database object, compare the data and record the difference Design Determine the comparison object Using springComponentScanThe thought ofThrough [email protected] to indicate that this is a component in theComponentScanScan [email protected] to register Determine the fields to compare There are many fields in a database object, which may all need to […]