notice 등록 기능 구현

This commit is contained in:
sdjo
2025-01-17 15:41:11 +09:00
parent 150046da1d
commit 819d554bac
10 changed files with 115 additions and 11 deletions

View File

@ -5,7 +5,7 @@ from taggit.managers import TaggableManager
class Post(models.Model):
title = models.CharField(max_length=200) # 제목
content = models.TextField() # 본문 (마크다운 저장)
contents = models.TextField() # 본문 (마크다운 저장)
summary = models.CharField(max_length=2000, blank=True, null=True) # 요약
created_at = models.DateTimeField(auto_now_add=True) # 작성일
updated_at = models.DateTimeField(auto_now=True) # 수정일
@ -15,7 +15,7 @@ class Post(models.Model):
def render_markdown(self):
"""마크다운을 HTML로 변환"""
md = MarkdownIt()
return md.render(self.content)
return md.render(self.contents)
def __str__(self):
return self.title