summaryrefslogtreecommitdiff
path: root/app/prompts
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-08-03 18:39:37 -0400
committerluxagraf <sng@luxagraf.net>2020-08-03 18:39:37 -0400
commit55409474092d594f3c483e0869b71f962c706322 (patch)
tree191608fdcf157e1be1477f4a6ad95e4af78c4f77 /app/prompts
parenteea8117ac3b58d8ac9eb1c9f94d27ac28fc67008 (diff)
added the rest of my recent work
Diffstat (limited to 'app/prompts')
-rw-r--r--app/prompts/models.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/prompts/models.py b/app/prompts/models.py
index 00ce3ce..7b5dc71 100644
--- a/app/prompts/models.py
+++ b/app/prompts/models.py
@@ -6,6 +6,23 @@ from django.apps import apps
from utils.util import render_images, markdown_to_html
+class Source(models.Model):
+ name = models.CharField(max_length=200)
+ link = models.CharField(max_length=400)
+ SOURCE_TYPE = (
+ (0, 'Book'),
+ (1, 'Website'),
+ (2, 'Other'),
+ )
+ source_type = models.IntegerField(choices=SOURCE_TYPE, default=0)
+
+ class Meta:
+ ordering = ('name',)
+
+ def __str__(self):
+ return self.name
+
+
class Prompt(models.Model):
title = models.CharField(max_length=200)
subtitle = models.CharField(max_length=200, blank=True)
@@ -57,3 +74,21 @@ class Prompt(models.Model):
md = render_images(self.body_markdown)
self.body_html = markdown_to_html(md)
super(Prompt, self).save(*args, **kwargs)
+
+
+
+class Source(models.Model):
+ name = models.CharField(max_length=200)
+ link = models.CharField(max_length=400)
+ SOURCE_TYPE = (
+ (0, 'Book'),
+ (1, 'Website'),
+ (2, 'Other'),
+ )
+ source_type = models.IntegerField(choices=SOURCE_TYPE, default=0)
+
+ class Meta:
+ ordering = ('name',)
+
+ def __str__(self):
+ return self.name