mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
Pluralize list operations ending in y correctly
This commit is contained in:
parent
559088463b
commit
e135ea88ba
|
@ -241,7 +241,10 @@ class AutoSchema(ViewInspector):
|
||||||
name = name[:-len(action)]
|
name = name[:-len(action)]
|
||||||
|
|
||||||
if action == 'list' and not name.endswith('s'): # listThings instead of listThing
|
if action == 'list' and not name.endswith('s'): # listThings instead of listThing
|
||||||
name += 's'
|
if name.endswith('y'):
|
||||||
|
name = name[:-1] + 'ies'
|
||||||
|
else:
|
||||||
|
name += 's'
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user