示例#1
0
文件: views.py 项目: pixyj/pramod.io
def projects(request):
    """
    1. Convert the markdown strings on the top of the page to html
    2. Render the response
    """
    heading_html = Post.md_to_html(HEADING)
    projects = Project.objects.filter(is_published=True).order_by('-created').prefetch_related('tags')
    for p in projects:
        p.tag_names = [tag.name for tag in p.tags.all()]
    return render(request, 'projects.html', {
        "heading": heading_html,
        "projects": projects
    })
示例#2
0
文件: models.py 项目: pixyj/pramod.io
 def html_description(self):
     return Post.md_to_html(self.description)
示例#3
0
文件: views.py 项目: pixyj/pramod.io
def about(request):
    about_html = Post.md_to_html(ABOUT_ME)
    print(about_html)
    return render(request, "about.html", {"about": about_html})