projects
/
styx.blog
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add feather icons and use them in the global nav, add RSS
[styx.blog]
/
core
/
models.py
diff --git
a/core/models.py
b/core/models.py
index
16fe65d
..
6537848
100644
(file)
--- a/
core/models.py
+++ b/
core/models.py
@@
-2,6
+2,7
@@
import re
from django.contrib.auth.models import User
from django.db import models
from django.contrib.auth.models import User
from django.db import models
+from django.urls import reverse
from django.utils.safestring import mark_safe
import commonmark
from django.utils.safestring import mark_safe
import commonmark
@@
-16,6
+17,9
@@
class Post(models.Model):
def __str__(self):
return self.title
def __str__(self):
return self.title
+ def get_absolute_url(self):
+ return reverse('post-detail', kwargs={ 'slug': self.slug })
+
@property
def body_html(self):
return mark_safe(commonmark.commonmark(self.body_markdown))
@property
def body_html(self):
return mark_safe(commonmark.commonmark(self.body_markdown))