I have a few apps in my Wagtail project and one of them is "news" which contains News(Page). I want to overwrite the title's label "title" to "headline" in the admin.
News._meta.get_field("title").verbose_name = "Headline"
As a result, I get all the titles' label "Headline" in all apps and pages. Why I've got this strange effect?
UPDATE:
# news/models.py
class NewsDetails(Page):
template = "news/news_details.html"
news_text = RichTextField(features=['h2', 'h3', 'bold', 'italic', 'link', 'ol', 'ul',])
news_image = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=False,
on_delete=models.SET_NULL,
)
content_panels = Page.content_panels + [
ImageChooserPanel("news_image"),
FieldPanel("news_text")
]
class Meta:
verbose_name = "News"
parent_page_types = ['news.NewsList']
NewsDetails._meta.get_field("title").verbose_name = "Headline"
verbose_name
in the model definition itself? Also include the full code for this part of admin so we can't find the issue. – Moises