Add support for .cdb.json

Fixes #231
This commit is contained in:
rubenwardy
2021-02-02 23:58:59 +00:00
parent 90aeb6e1a7
commit 8225e4098b
7 changed files with 70 additions and 20 deletions

View File

@@ -727,6 +727,10 @@ class ContentWarning(db.Model):
regex = re.compile("[^a-z_]")
self.name = regex.sub("", self.title.lower().replace(" ", "_"))
def getAsDictionary(self):
description = self.description if self.description != "" else None
return { "name": self.name, "title": self.title, "description": description }
class Tag(db.Model):
id = db.Column(db.Integer, primary_key=True)