#model
class Article(models.Model):
udate=models.DateTimeField(auto_now=True,auto_now_add=True)
markdown_content=models.TextField()
html_content=models.TextField(editable=False)
def save(self):
self.html_content=markdown(self.markdown_content)
self.update=datetime.datetime.now()
super(Article,self).save()
#template
<div class="text">
{{ article.html_content|safe}}
<span>Update:{{article.update }}</span>
</div>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/A2TjUW3Ad7AJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.