(post)
return
Create a herald blog post from a post.
Create a herald blog post from a post.
Create a herald blog post from a post .
def herald_blog(post):
    """
    Create a herald blog post from a post.

    """

    # Get the Biostar Herald blog.
    hlink = reverse('post_topic', kwargs=dict(topic='herald'))
    blog = Blog.objects.filter(link=hlink).first()

    content = post.content.split('.')[:2]
    content = '.'.join(content) + '...'

    # Create the blog post
    BlogPost.objects.create(title=post.title, blog=blog, link=post.get_absolute_url(),
                            uid=post.uid, content=content,
                            creation_date=post.creation_date, insert_date='', published=True)
    return
def herald_blog ( post ) : # Get the Biostar Herald blog. hlink = reverse ( 'post_topic' , kwargs = dict ( topic = 'herald' ) ) blog = Blog . objects . filter ( link = hlink ) . first ( ) content = post . content . split ( '.' ) [ : 2 ] content = '.' . join ( content ) + '...' # Create the blog post BlogPost . objects . create ( title = post . title , blog = blog , link = post . get_absolute_url ( ) , uid = post . uid , content = content , creation_date = post . creation_date , insert_date = '' , published = True ) return