File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 7
7
"""
8
8
from collections import namedtuple
9
9
10
- FieldInfo = namedtuple ('FieldResult ' , [
10
+ FieldInfo = namedtuple ('FieldInfo ' , [
11
11
'pk' , # Model field instance
12
12
'fields' , # Dict of field name -> model field instance
13
13
'forward_relations' , # Dict of field name -> RelationInfo
Original file line number Diff line number Diff line change 9
9
from rest_framework .utils import json
10
10
from rest_framework .utils .breadcrumbs import get_breadcrumbs
11
11
from rest_framework .utils .formatting import lazy_format
12
+ from rest_framework .utils .model_meta import FieldInfo , RelationInfo
12
13
from rest_framework .utils .urls import remove_query_param , replace_query_param
13
14
from rest_framework .views import APIView
14
15
from rest_framework .viewsets import ModelViewSet
@@ -267,3 +268,9 @@ def test_it_formats_lazily(self):
267
268
assert message .format .call_count == 1
268
269
str (formatted )
269
270
assert message .format .call_count == 1
271
+
272
+
273
+ class ModelMetaNamedTupleNames (TestCase ):
274
+ def test_named_tuple_names (self ):
275
+ assert FieldInfo .__name__ == 'FieldInfo'
276
+ assert RelationInfo .__name__ == 'RelationInfo'
You can’t perform that action at this time.
0 commit comments