From 757deeaaeaba84ffc5942c8922ea6c8981a00aa1 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Tue, 29 Dec 2020 12:41:10 -0800 Subject: [PATCH] add debug text --- suchwow/models.py | 18 ++++++++++++++++++ suchwow/templates/post/read.html | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/suchwow/models.py b/suchwow/models.py index ab5493d..fc6ea67 100644 --- a/suchwow/models.py +++ b/suchwow/models.py @@ -21,6 +21,24 @@ class Post(Model): to_discord = BooleanField(default=False) approved = BooleanField(default=False) + def show(self): + return { + 'id': self.id, + 'title': self.title, + 'text': self.text, + 'submitter': self.submitter, + 'image_name': self.image_name, + 'readonly': self.readonly, + 'hidden': self.hidden, + 'account_index': self.account_index, + 'address_index': self.address_index, + 'timestamp': self.timestamp, + 'reddit_url': self.reddit_url, + 'to_reddit': self.to_reddit, + 'to_discord': self.to_discord, + 'approved': self.approved, + } + class Meta: database = db diff --git a/suchwow/templates/post/read.html b/suchwow/templates/post/read.html index cd585e7..0c69005 100644 --- a/suchwow/templates/post/read.html +++ b/suchwow/templates/post/read.html @@ -51,6 +51,10 @@ {% endif %} + {% if config.DEBUG %} + {{ post.show() }} + {% endif %} + {# {% if "auth" in session %} {% if session.auth.preferred_username == post.submitter %}