mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-27 01:36:11 -06:00
Update schema.py
This commit is contained in:
parent
3808a2735f
commit
5437f57ef2
@ -245,12 +245,9 @@ class NetBoxAutoSchema(AutoSchema):
|
|||||||
"""
|
"""
|
||||||
Generate a docstring for the method. It also takes into account whether the method is for list or detail.
|
Generate a docstring for the method. It also takes into account whether the method is for list or detail.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Determine if the method is for list or detail.
|
|
||||||
is_list = not '{id}' in self.path
|
|
||||||
|
|
||||||
model_name = self.view.queryset.model._meta.verbose_name
|
model_name = self.view.queryset.model._meta.verbose_name
|
||||||
|
|
||||||
if is_list:
|
# Determine if the method is for list or detail.
|
||||||
return f"{self.method.capitalize()} a list of {model_name} objects."
|
if '{id}' in self.path:
|
||||||
return f"{self.method.capitalize()} a {model_name} object."
|
return f"{self.method.capitalize()} a {model_name} object."
|
||||||
|
return f"{self.method.capitalize()} a list of {model_name} objects."
|
||||||
|
Loading…
Reference in New Issue
Block a user