##// END OF EJS Templates
Include posts that were created during one diff and changed in another when...
Include posts that were created during one diff and changed in another when getting thread diff

File last commit:

r322:6b051ab1 default
r382:c6fee823 default
Show More
board.py
22 lines | 565 B | text/x-python | PythonLexer
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from boards.models import Post
from boards.views import thread
from django import template
register = template.Library()
@register.simple_tag(name='post_url')
def post_url(*args, **kwargs):
post_id = args[0]
post = get_object_or_404(Post, id=post_id)
if post.thread:
link = reverse(thread, kwargs={'post_id': post.thread.id}) \
+ '#' + str(post_id)
else:
link = reverse(thread, kwargs={'post_id': post_id})
return link