-
Notifications
You must be signed in to change notification settings - Fork 0
Pluralized URL slugs for Custom Object Types #179
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
Conversation
Merge Feature
161 fix multi object field
Check if unique flag raise validation error if non unique data
NPL-411 raise validation error if using reserved names for fields
Revert "Check if unique flag raise validation error if non unique data"
Update docs for 0.2.0
NPL-389 fix unique check
174 fix delete of CO on detail page
Bump version to 0.2.0 in pyproject.toml
…bose_name/verbose_name_plural in templates
max_length=100, | ||
unique=True, | ||
help_text=_("Internal lowercased object name, e.g. \"vendor_policy\""), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says lowercased but there is no validation or conversion on this, should we enforce that?
netbox_custom_objects/models.py
Outdated
verbose_name_plural = models.CharField(max_length=100, blank=True) | ||
slug = models.SlugField(max_length=100, null=True, unique=True, db_index=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add the help_text here? same comment above, do we want to enforce lowercase?
Also - do we want this auto-generated off of name (can change but gives a default)?
Introduces
verbose_name
andslug
fields which allow URL patterns (both for UI and API) to be pluralized, and template usages to adhere to a user-controllable pattern.name
is the "internal" lowercase model name (required)verbose_name
is the human-readable, capitalized and spaced name, optionalverbose_name_plural
is the plural version of the above, optional, (templates will useverbose_name
+ "s" if not set)slug
is the slugified version ofverbose_name_plural
, with aSlugField
and picker similar to that used in Sites