Improve admin preview for doc page redirect
authorJonathan S. Katz <jonathan.katz@excoventures.com>
Wed, 19 May 2021 20:00:10 +0000 (16:00 -0400)
committerJonathan S. Katz <jonathan.katz@excoventures.com>
Wed, 19 May 2021 20:00:10 +0000 (16:00 -0400)
This presents the redirection in a legible format, instead of
having to click into each list item to figure out what it is.

pgweb/docs/models.py

index 89e54bd8c012cb48cca9eab25a62372bb2fe3371..9b71f6ebdd8a37472faac34b29b7f954684cbb4b 100644 (file)
@@ -42,5 +42,8 @@ class DocPageRedirect(models.Model):
     redirect_from = models.CharField(max_length=64, null=False, blank=False, unique=True, help_text='Page to redirect from, e.g. "old_page.html"')
     redirect_to = models.CharField(max_length=64, null=False, blank=False, unique=True, help_text='Page to redirect to, e.g. "new_page.html"')
 
+    def __str__(self):
+        return "%s => %s" % (self.redirect_from, self.redirect_to)
+
     class Meta:
         verbose_name_plural = "Doc page redirects"