INNER CODE UNIT · Python

BaseNestedFieldSerializer

yezyilomo/django-restql · django_restql/fields.py:276

    class BaseNestedFieldSerializer(serializer_class, BaseNestedField):

        # These variables might be used before `to_internal_value` method is called
        # so we're creating them to make sure they're available
        # as long as the class is created
        is_replaceable = accept_pk_only or accept_pk
        should_delete_on_null = delete_on_null

        class Meta(serializer_class.Meta):
            list_serializer_class = BaseNestedFieldListSerializer

        def run_validation(self, data):
            # Run `to_internal_value` only nothing more
            # This is needed only on DRF 3.8.x due to a bug on it
            # This function can be removed on other supported DRF versions
            # i.e v3.7 v3.9 v3.10 etc doesn't need this function
            return self.to_internal_value(data)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…