From ce1ac8d5e3e567d9358812a2a8109e93c466b031 Mon Sep 17 00:00:00 2001 From: Stuart Maxwell Date: Wed, 1 May 2024 22:21:39 +1200 Subject: [PATCH 1/2] Add model meta fields --- djpress/models/category.py | 6 ++++++ djpress/models/content.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/djpress/models/category.py b/djpress/models/category.py index 9222e50..cd238df 100644 --- a/djpress/models/category.py +++ b/djpress/models/category.py @@ -65,6 +65,12 @@ class Category(models.Model): # Custom Manager objects: "CategoryManager" = CategoryManager() + class Meta: + """Meta options for the category model.""" + + verbose_name = "category" + verbose_name_plural = "catregories" + def __str__(self: "Category") -> str: """Return the string representation of the category.""" return self.name diff --git a/djpress/models/content.py b/djpress/models/content.py index 1b63626..3db0d82 100644 --- a/djpress/models/content.py +++ b/djpress/models/content.py @@ -163,6 +163,12 @@ class Content(models.Model): objects = models.Manager() post_objects: "PostsManager" = PostsManager() + class Meta: + """Meta options for the content model.""" + + verbose_name = "content" + verbose_name_plural = "contents" + def __str__(self: "Content") -> str: """Return the string representation of the content.""" return self.title From 51a28faf1ba565c7d318e62d67babdde2d52aceb Mon Sep 17 00:00:00 2001 From: Stuart Maxwell Date: Wed, 1 May 2024 22:22:38 +1200 Subject: [PATCH 2/2] Remove test code --- templates/djpress/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/djpress/index.html b/templates/djpress/index.html index a45b352..95378c8 100644 --- a/templates/djpress/index.html +++ b/templates/djpress/index.html @@ -29,8 +29,6 @@ {% elif posts %} -

The posts go here.

- {% for post in posts %} {% include "djpress/snippets/content_summary.html" %}