mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -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.
|
||||
"""
|
||||
|
||||
# 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
|
||||
|
||||
if is_list:
|
||||
return f"{self.method.capitalize()} a list of {model_name} objects."
|
||||
return f"{self.method.capitalize()} a {model_name} object."
|
||||
# Determine if the method is for list or detail.
|
||||
if '{id}' in self.path:
|
||||
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