@@ -34,13 +34,13 @@ def __init__(self, **kwargs):
34
34
35
35
def __new__ (cls , * args , ** kwargs ):
36
36
# We override this method in order to automagically create
37
- # `ManyRelation ` classes instead when `many=True` is set.
37
+ # `ManyRelatedField ` classes instead when `many=True` is set.
38
38
if kwargs .pop ('many' , False ):
39
39
list_kwargs = {'child_relation' : cls (* args , ** kwargs )}
40
40
for key in kwargs .keys ():
41
41
if key in MANY_RELATION_KWARGS :
42
42
list_kwargs [key ] = kwargs [key ]
43
- return ManyRelation (** list_kwargs )
43
+ return ManyRelatedField (** list_kwargs )
44
44
return super (RelatedField , cls ).__new__ (cls , * args , ** kwargs )
45
45
46
46
def run_validation (self , data = empty ):
@@ -286,12 +286,12 @@ def to_representation(self, obj):
286
286
return getattr (obj , self .slug_field )
287
287
288
288
289
- class ManyRelation (Field ):
289
+ class ManyRelatedField (Field ):
290
290
"""
291
291
Relationships with `many=True` transparently get coerced into instead being
292
- a ManyRelation with a child relationship.
292
+ a ManyRelatedField with a child relationship.
293
293
294
- The `ManyRelation ` class is responsible for handling iterating through
294
+ The `ManyRelatedField ` class is responsible for handling iterating through
295
295
the values and passing each one to the child relationship.
296
296
297
297
You shouldn't need to be using this class directly yourself.
@@ -302,7 +302,7 @@ class ManyRelation(Field):
302
302
def __init__ (self , child_relation = None , * args , ** kwargs ):
303
303
self .child_relation = child_relation
304
304
assert child_relation is not None , '`child_relation` is a required argument.'
305
- super (ManyRelation , self ).__init__ (* args , ** kwargs )
305
+ super (ManyRelatedField , self ).__init__ (* args , ** kwargs )
306
306
self .child_relation .bind (field_name = '' , parent = self )
307
307
308
308
def get_value (self , dictionary ):
0 commit comments