summaryrefslogtreecommitdiff
path: root/app/ccg_notes/models.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-07-08 09:36:58 -0400
committerluxagraf <sng@luxagraf.net>2018-07-08 09:36:58 -0400
commita34140c05956d5dfc6ef38d264bdcd7e32d4e22d (patch)
tree7fc5a8e4cddd498bc9b967bd8d397f1cceaa68d1 /app/ccg_notes/models.py
parent6a2393e6819ea09aeb559354a69746750aa8cbdf (diff)
moved ccg notes to unused
Diffstat (limited to 'app/ccg_notes/models.py')
-rw-r--r--app/ccg_notes/models.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/app/ccg_notes/models.py b/app/ccg_notes/models.py
deleted file mode 100644
index b235d36..0000000
--- a/app/ccg_notes/models.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from django.contrib.gis.db import models
-from django.utils import timezone
-from django.core.urlresolvers import reverse
-
-from taggit.managers import TaggableManager
-from utils.widgets import markdown_to_html
-from jrnl.models import render_images
-
-
-class CcgNote(models.Model):
- title = models.CharField(max_length=250, null=True, blank=True)
- slug = models.SlugField(unique_for_date='pub_date', blank=True)
- pub_date = models.DateTimeField(default=timezone.now)
- date_last_updated = models.DateTimeField('Date', blank=True)
- body_html = models.TextField(blank=True)
- body_markdown = models.TextField('Note')
- PUB_STATUS = (
- (0, 'Draft'),
- (1, 'Published'),
- )
- status = models.IntegerField(choices=PUB_STATUS, default=1)
- tags = TaggableManager(blank=True)
-
- def __str__(self):
- return self.title
-
- def get_absolute_url(self):
- return reverse("ccg_notes:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
-
- def save(self, *args, **kwargs):
- md = render_images(self.body_markdown)
- self.body_html = markdown_to_html(md)
- if not self.id:
- self.pub_date = timezone.now()
- self.date_last_updated = timezone.now()
- super(CcgNote, self).save()