File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
sphinxcontrib_django/docstrings Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -31,20 +31,19 @@ def get_field_type(field, include_role=True):
3131 f":class:`~{ type (field ).__module__ } .{ type (field ).__name__ } ` to"
3232 f" :class:`~{ to .__module__ } .{ to .__name__ } `"
3333 )
34- elif isinstance (field , models .fields .reverse_related .ForeignObjectRel ):
34+ if isinstance (field , models .fields .reverse_related .ForeignObjectRel ):
3535 to = field .remote_field .model
3636 return (
3737 "Reverse"
3838 f" :class:`~{ type (field .remote_field ).__module__ } .{ type (field .remote_field ).__name__ } `"
3939 f" from :class:`~{ to .__module__ } .{ to .__name__ } `"
4040 )
41- else :
42- if include_role :
43- # For the docstrings of attributes, the :class: role is required
44- return f":class:`~{ type (field ).__module__ } .{ type (field ).__name__ } `"
45- else :
46- # For the :param: role in class docstrings, the :class: role is not required
47- return f"~{ type (field ).__module__ } .{ type (field ).__name__ } "
41+ if include_role :
42+ # For the docstrings of attributes, the :class: role is required
43+ return f":class:`~{ type (field ).__module__ } .{ type (field ).__name__ } `"
44+
45+ # For the :param: role in class docstrings, the :class: role is not required
46+ return f"~{ type (field ).__module__ } .{ type (field ).__name__ } "
4847
4948
5049def get_field_verbose_name (field ):
You can’t perform that action at this time.
0 commit comments