Features: 1) Add verbose_name attribute to multiple Slug fields for better clarity;
Fixes: 1) Correct conditional handling of `fieldsets` to avoid duplicate `metadata` fields in admin view; Extra: n/a;
This commit is contained in:
parent
43141bc3d5
commit
35ac700a44
2 changed files with 5 additions and 2 deletions
|
|
@ -63,7 +63,8 @@ class FieldsetsMixin:
|
|||
if any(f.name == "uuid" for f in opts.fields):
|
||||
if any(f.name == "slug" for f in opts.fields):
|
||||
fieldsets.append((_("metadata"), {"fields": ["uuid", "slug"]}))
|
||||
fieldsets.append((_("metadata"), {"fields": ["uuid"]}))
|
||||
else:
|
||||
fieldsets.append((_("metadata"), {"fields": ["uuid"]}))
|
||||
|
||||
ts = []
|
||||
for name in ("created", "modified"):
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ class Category(ExportModelOperationsMixin("category"), NiceModel, MPTTModel):
|
|||
max_length=88,
|
||||
overwrite=True,
|
||||
null=True,
|
||||
verbose_name=_("Slug"),
|
||||
)
|
||||
tags: CategoryTag = ManyToManyField( # type: ignore
|
||||
"core.CategoryTag",
|
||||
|
|
@ -303,7 +304,7 @@ class Brand(ExportModelOperationsMixin("brand"), NiceModel):
|
|||
overwrite=True,
|
||||
null=True,
|
||||
slugify_function=unicode_slugify_function,
|
||||
verbose_name=_("brand slug"),
|
||||
verbose_name=_("Slug"),
|
||||
)
|
||||
priority: int = PositiveIntegerField( # type: ignore
|
||||
default=0,
|
||||
|
|
@ -384,6 +385,7 @@ class Product(ExportModelOperationsMixin("product"), NiceModel):
|
|||
slugify_function=unicode_slugify_function,
|
||||
editable=False,
|
||||
null=True,
|
||||
verbose_name=_("Slug"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Loading…
Reference in a new issue