diff --git a/BDSM/models.py b/BDSM/models.py index 068e833..07601ef 100644 --- a/BDSM/models.py +++ b/BDSM/models.py @@ -26,7 +26,7 @@ class Toot(db.Model): favourites_count = db.Column(db.Integer) language = db.Column(db.Text) -class Reblog(db.Model): +class Other(db.Model): id = db.Column(db.Integer, primary_key=True) acct = db.Column(db.Text) url = db.Column(db.Text) diff --git a/BDSM/toot.py b/BDSM/toot.py index 6ade9e1..b66b410 100644 --- a/BDSM/toot.py +++ b/BDSM/toot.py @@ -2,7 +2,7 @@ from mastodon import Mastodon from BDSM import db -from BDSM.models import Reblog, Toot, Tag, Media, Emoji, Poll +from BDSM.models import Other, Toot, Tag, Media, Emoji, Poll import sys def app_register(url): @@ -160,7 +160,7 @@ def archive_toot(url): favourites_count = status['favourites_count'] language = status['language'] - table = Reblog() if is_reblog else Toot() + table = Other() if is_reblog else Toot() table.id=id table.acct = acct table.url=url diff --git a/BDSM/views.py b/BDSM/views.py index cabf3a2..42288f5 100644 --- a/BDSM/views.py +++ b/BDSM/views.py @@ -5,7 +5,7 @@ import pytz from flask import render_template, request, url_for, redirect, flash from flask_sqlalchemy import Pagination from BDSM import app, db -from BDSM.models import Media, Settings, Toot, Emoji, Reblog +from BDSM.models import Media, Settings, Toot, Emoji, Other from BDSM.toot import app_register, archive_toot from mastodon import Mastodon from types import SimpleNamespace @@ -179,7 +179,7 @@ def process_toot(toots_): toot = SimpleNamespace(**toot.__dict__) toot.is_reblog = True else: - toot = Reblog.query.get(toot.reblog_id) + toot = Other.query.get(toot.reblog_id) toot = SimpleNamespace(**toot.__dict__) toot.is_reblog = True