Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pluralization update #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

pluralization update #60

wants to merge 1 commit into from

Conversation

jameswinegar
Copy link

In commit 90f506a, there was a change in the name standardization of URLs and instead of using verbose_name_plural, the library uses model_name. This leads to some annoyances with multiple word models such as EntityAttrbiute having a URL of entityattribute instead of entity_attribute.

A PR could be done to use verbose_name_plural if it exists with a change to _meta.verbose_name_plural.replace(" ","_").lower(). The replacement would be required because inflector operates on the last word in the string and doesn't normalize the spaces.

from inflector import Inflector
from django.utils.module_loading import import_string

inflector_language = import_string("inflector.English")
inflector = Inflector(inflector_language)
print(inflector.pluralize("Two Word").lower())
print(inflector.pluralize("Two_Word").lower())
two words
two_words

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant