File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from django .core .exceptions import ValidationError
2- from django .db .models import ManyToManyField
32from rest_framework .permissions import BasePermission
43from rest_framework .relations import PrimaryKeyRelatedField
54from rest_framework .serializers import HyperlinkedIdentityField , JSONField , ModelSerializer
@@ -82,7 +81,7 @@ class SubformValidationMixin:
8281 def _validate (self , attrs ):
8382 instance = self .instance or self .Meta .model ()
8483 for field , field_value in attrs .items ():
85- if not isinstance ( instance ._meta .get_field (field ), ManyToManyField ) :
84+ if not instance ._meta .get_field (field ). many_to_many :
8685 setattr (instance , field , field_value )
8786 if not instance .subform_type :
8887 return
Original file line number Diff line number Diff line change 11# NetBox 4.6
22
3+ from pydoc import locate
34
45from .old import *
6+
7+
8+ ChoicesType = locate ("django.db.models.enums.ChoicesType" )
You can’t perform that action at this time.
0 commit comments